Skip to content

abhaynaik-dev/anlogger

Repository files navigation


📝 ANLogger 📝

This was a simple module that I used in the majority of my applications; it is now a library. A simple way to retrieve logs from a device without requiring adb access or external read/ write permission, as well as an easy way to send the log file via email. It helps me a lot, hope it does to you too.

Happy Debugging !!!

📖 Prerequisite

  1. Use Timber as a default logging library.
  2. Do not plant or use any custom a Timber tree, ANLogger will take care of everything.

⭕ Usage

  1. Dependency
repositories {
  mavenCentral()
}

dependencies {
  implementation "io.github.abhaynaik-dev:anlogger:0.1.1"
}
  1. Configure ANLogger
//Use this in onCreate() of application class
ANLogger.setup(this, "<TAG>" ,ANLoggingLevel.AN_FILE_LOGGING)
//Logging levels
//AN_NONE - To be used in production mode
//AN_FILE_LOGGING - To write Timber logs in file
//AN_ADB_LOGGING - Default Timber.DebugTree() usage, must be used in debug mode only
  1. Share single log file

This should be used only with AN_FILE_LOGGING logging level
This API will show a dialog with list of available log files. User can select a file and share it via mail

ANLogger.shareLogFile(context = this)
  1. Share all log files at once

This should be used only with AN_FILE_LOGGING logging level
This API will share all available log files via mail

ANLogger.shareAllLogFiles(context = this)
  1. Delete all log files

This should be used only with AN_FILE_LOGGING logging level
This API will delete all availble log files

ANLogger.clearLogFiles()

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages