Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Timber log is not printing in debug console or Logcat

Log.i("Test", "Hello, Log")
Timber.i("Hello, Timber")

I can see the Log.i log in Debug console and Logcat, I don't see the Timber log in anywhere.

I/Test: Hello, Log

I'm building in stagingDebug mode. (I have 4 options, production debug and release and staging debug and release)

What I'm missing?

like image 792
Expert wanna be Avatar asked Apr 24 '18 08:04

Expert wanna be


1 Answers

Make sure that you have initialised Timber in Application class. Following code might help :-

public class MyApplication extends Application {

    @Override
    public void onCreate() {
        super.onCreate();
        // This will initialise Timber
        if (BuildConfig.DEBUG) {
        Timber.plant(new Timber.DebugTree());
        }
   }
}
like image 156
Rohan Kandwal Avatar answered Sep 23 '22 09:09

Rohan Kandwal