Skip to content

Latest commit

 

History

History
43 lines (31 loc) · 1.2 KB

File metadata and controls

43 lines (31 loc) · 1.2 KB

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>")
}