ktimber

Additional

Language
Kotlin
Version
0.11 (Dec 12, 2019)
Created
Nov 7, 2019
Updated
Feb 26, 2020 (Retired)
Owner
Cristi Dita (ditacristianionut)
Contributors
Cristi Dita (ditacristianionut)
ditacristian
2
Activity
Badge
Generate
Download
Source code

ktimber

KTimber is Kotlin logging library based on JakeWharton's Timber library that brings some extra functionality:

  • A built in file logger that formats the logs and writes them to a HTML file
  • The posibility to easily share the logs file

You can also:

  • Use the built in Trees for Release and Debug modes
  • View and delete log files directly

Usage

Init the logger before using it (ideally at the app level):

If you want to save logs to file:

$ KTimber.startWithFileLogger(context)

else

$ KTimber.start(context, minimumLoggingLevel)

To log an event use any of these functions:

  • logInfo()
  • logVerbose()
  • logDebug()
  • logWarn()
  • logError()
  • logAssert()

To share/open/delete the logs file:

  • shareLogsFile(activity: AppCompatActivity, emailAddress: String)
  • deleteLogsFile(context: Context)
  • openLogsFile(context: Context)

Or you can usue the extensions:

  • AppCompatActivity.shareLogsFile(emailAddress: String)
  • AppCompatActivity.deleteLogsFile()
  • AppCompatActivity.openLogsFile()

License

Apache Version 2.0