Skip to content

This library provides a logger mechanism inspired from both Timber and SLF4J.

License

Notifications You must be signed in to change notification settings

BeApp/beapp.library.logger.android

Repository files navigation

This library provides a logger mechanism inspired from both Timber and SLF4J.

Usage

Two steps are needed :

  1. Configure Logger with as much appenders you as want, in the onCreate of your application class
  2. Call Logger's static methods everywhere throughout your app
  3. (optional) You can also use a different formatter to fit your needs on message formatting
Logger.add(DebugAppender("MyProjectTag"))
Logger.add(FirebaseCrashReportingAppender())
Logger.add(HuaweiCrashReportingAppender())
Logger.add(FileAppender("myproject-{date}.log"))

// Optional
Logger.formatter(DefaultFormatter())

Logger.trace("This is trace test number %d", 1)
Logger.debug("This is debug test number %d", 1)
Logger.info("This is info test number %d", 1)
Logger.warn("This is warning test number %d", 1)
Logger.error("This is error test number %d", exception, 1)

Installation

Add jcenter's repository in your project's repositories list, then add the dependency.

repositories {
	jcenter()
	// ...
	maven(url = "http://repository.beapp.fr/libs-release-local")
}

dependencies {
	implementation("fr.beapp.logger:logger:<latest-release>")
}

About

This library provides a logger mechanism inspired from both Timber and SLF4J.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •