I just updated to Android Studio Giraffe 2022.3.1 and the new Logcat mode has been turned on for me. This was off for me in the previous version as I opted out.
Is there a way to keep the old Logcat?
I just updated to Android Studio Giraffe 2022.3.1 and the new Logcat mode has been turned on for me. This was off for me in the previous version as I opted out.
Is there a way to keep the old Logcat?
I despise the new logcat. It prints out so much useless logs that clutters up everything and hides the logs I actually need to debug.
I'm now using the Timber
library to filter out all the garbage I don't care to see
implementation 'com.jakewharton.timber:timber:4.7.1'
Create custom tree class:
class CustomTagTree(private val customTag: String) : Timber.DebugTree() {
override fun createStackElementTag(element: StackTraceElement): String {
return customTag
}
}
Create application class:
class BaseApplication : Application() {
override fun onCreate() {
super.onCreate()
if (BuildConfig.DEBUG) {
Timber.plant(CustomTagTree("ihatethenewlogcat"))
}
}
}
Add name to manifest:
<application
android:name=".BaseApplication"
And now use
Timber.d("Called")