12

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?

New Logcat in Android Studio

Doron Yakovlev Golani
  • 5,188
  • 9
  • 36
  • 60
  • 2
    This may help https://stackoverflow.com/questions/73775051/how-to-get-back-logcat-before-dolphin-version-on-android-studio – Rodrigo Ferreira Jul 25 '23 at 22:37
  • 5
    Thank you @RodrigoFerreira, but the answer to this question is the solution I used before Giraffe. – Doron Yakovlev Golani Jul 25 '23 at 23:01
  • 7
    seems that awful new Logcat is no longer experimental, thus we are f**d and must adapt to it – JaviMar Jul 26 '23 at 13:20
  • 9
    This is the shittiest update with no option to fallback to the legacy logcat. I can't even filter only `DEBUG` messages because the filters are `Filter by DEBUG or higher` which includes Warning, Info as well. I don't understand what do the teams even smoke before finalising something like this. – Darshan Jul 27 '23 at 11:19
  • 1
    One thing that I found out that makes this more bearable is to use the "Compact View" – Doron Yakovlev Golani Jul 31 '23 at 21:14
  • 1
    I even downgraded Android Studio a few months ago because of the new logcat. Now I'm forced to upgrade to it because of a new project not supporting old versions of AS :( Now I run into this annoying logcat again, searching for a solution. – DIRTY DAVE Aug 10 '23 at 22:11

1 Answers1

1

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.

enter image description here

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")

with a filter in the logcat tag:ihatethenewlogcat enter image description here

DIRTY DAVE
  • 2,523
  • 2
  • 20
  • 83