JakeWharton / timber

A logger with a small, extensible API which provides utility on top of Android's normal Log class.
https://jakewharton.github.io/timber/docs/5.x/
Apache License 2.0
10.46k stars 962 forks source link

Calling Timber.d() prints the same message multiple times #402

Closed Partha11 closed 4 years ago

Partha11 commented 4 years ago

After upgrading to kotlin-gradle-plugin version to 1.4.0, timber seems to act a bit weird. Every time I close my app and reopen it, timber would print the debug message multiple times (E.g opening the app 2nd time causes to print the message 2 times, opening the app 3rd time causes it to print 3 times and this goes on). But Log.d works fine. Is this an issue with the kotlin version?

119471786_321840082382587_3217493154192213630_n

JakeWharton commented 4 years ago

Where you are installing the debug tree?

Partha11 commented 4 years ago

I'm installing the debug tree on the application class

Partha11 commented 4 years ago

Fixed the issue. I was calling Timber.plant(DebugTree()) twice, once inside my application class (onCreate) and the other inside my splash activity init which I never noticed. Thanks for pointing me to the right direction <3