timber-android

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?


Solution

  • 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 initialize Timber
                if (BuildConfig.DEBUG) {
                    Timber.plant(new Timber.DebugTree());
                }
           }
        }