Timber logs are not visible in Android Studio Dolphin 2021.3.1
Log Statements
Timber.d("onCreateViewCalled using Timber")
Log.d("Login", "onCreateViewCalled using Log")
OUTPUT
Only the Log library logs are visible and not the Timber ones.
Timber logs are not visible in Android Studio Dolphin 2021.3.1
Log Statements
Timber.d("onCreateViewCalled using Timber")
Log.d("Login", "onCreateViewCalled using Log")
OUTPUT
Only the Log library logs are visible and not the Timber ones.
Make sure you're using your app module's BuildConfig
if (com.my.app.BuildConfig.DEBUG) {
Timber.plant(Timber.DebugTree())
}
I was using the wrong one
if (org.koin.android.BuildConfig.DEBUG) { // <- NOT MY CONFIG
Timber.plant(Timber.DebugTree())
}
I have solved the issue by enabling Use libusb backend
. Navigate to
Android Studio -> Preferences -> Build, Execution, Deployment -> Debugger -> then check Use libusb backend
Added this for future reference
You have to plant a timber debug tree by initializing Timber
in the Application
Class:
class MyApplication : Application() {
override fun onCreate() {
super.onCreate()
if(BuildConfig.DEBUG){
Timber.plant(Timber.DebugTree())
}
}
}
Add the MyApplication class to the AndroidManifest.xml
like below:
<application
android:name=".MyApplication">
...
</application>
© 2022 - 2024 — McMap. All rights reserved.