skip to Main Content

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

2

Answers


  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

    Login or Signup to reply.
  2. Its possible to almost return to the previous format. Open the logcat view, click side button "Configure Logcat Formatting Options", then "Modify views". Now unselect all options (or keep just Timestamp): Timestamp, Tag, Level, Process ID and Package Name.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search