Plant a tree with Timber logs

If you want to log something in your debug app, and you for sure want, then you most probably heard about Timber library. It’s one of the most popular Android libraries, simple to use, but quite powerful. This is how you can make a basic setup, to logs messages only in debug build:

class MyApp: Application(){
  override fun onCreate(){	
   super.onCreate()
   if(BuildConfig.DEBUG){
   	Timber.plant(Timber.DebugTree())
   }
  }
}

Dodaj komentarz

Twój adres e-mail nie zostanie opublikowany. Wymagane pola są oznaczone *