I assume most of you are aware of android.util.Log All logging methods accept \'String tag\' as a first argument.
And my question is How do you usually tag y
they use Timber for the IOsched app 2019 to show debug info:
implementation 'com.jakewharton.timber:timber:4.7.1'
class ApplicationController: Application() {
override fun onCreate() {
super.onCreate()
if(BuildConfig.DEBUG){
Timber.plant(Timber.DebugTree())
}
}
// enables logs for every activity and service of the application
// needs to be registered in manifest like:
usage
Timber.e("Error Message")
// will print -> D/MainActivity: Error Message
Timber.d("Debug Message");
Timber.tag("new tag").e("error message");
note that this makes the Logs available only during DEBUG state and facilitates you the task of removing them manually for the launch on Google Play -
when release the app on the play store, we need to remove all Log statement from the app, so that none of the application data such as user information, hidden application data, auth-tokens are available to user in logcat as plain text
check out this article https://medium.com/mindorks/better-logging-in-android-using-timber-72e40cc2293d