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 !!!- Use Timber as a default logging library.
- Do not plant or use any custom a
Timbertree,ANLoggerwill take care of everything.
- Dependency
repositories {
mavenCentral()
}
dependencies {
implementation "io.github.abhaynaik-dev:anlogger:0.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- Share single log file
This should be used only with
AN_FILE_LOGGINGlogging 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)- Share all log files at once
This should be used only with
AN_FILE_LOGGINGlogging level
This API will share all available log files via mail
ANLogger.shareAllLogFiles(context = this)- Delete all log files
This should be used only with
AN_FILE_LOGGINGlogging level
This API will delete all availble log files
ANLogger.clearLogFiles()