Search code examples
androidlogcat

How to convince Logcat to print only valuable data, and prevent vomiting useless spam logs


I want to make my logcat to only print data which I would like to see by calling

Log.i(...)

However, logcat vomits EVERYTHING to my log, and I'm tired of filtering information with endless regex or by tags with every single time I open a project.

Is there an easy and reliable solution for this?

For example:

2018-11-27 11:23:11.173 5084-5111/com.platinum D/EGL_emulation: eglMakeCurrent: 0x7c2d1d4fa220: ver 3 0 (tinfo 0x7c2d24e23bc0)
2018-11-27 11:23:11.471 5084-5084/com.platinum D/SQL Log: SQLiteQuery: SELECT * FROM DOG
2018-11-27 11:23:11.941 5084-5084/com.platinum W/ActivityThread: handleWindowVisibility: no activity for token android.os.BinderProxy@cb53553
2018-11-27 11:23:12.170 5084-5111/com.platinum D/EGL_emulation: eglMakeCurrent: 0x7c2d1d4fa220: ver 3 0 (tinfo 0x7c2d24e23bc0)
2018-11-27 11:23:12.198 5084-5111/com.platinum D/EGL_emulation: eglMakeCurrent: 0x7c2d1d4fa220: ver 3 0 (tinfo 0x7c2d24e23bc0)
2018-11-27 11:23:12.237 5084-5111/com.platinum D/EGL_emulation: eglMakeCurrent: 0x7c2d1d4fa220: ver 3 0 (tinfo 0x7c2d24e23bc0)
2018-11-27 11:23:12.287 5084-5111/com.platinum I/chatty: uid=10085(com.platinum) RenderThread identical 2 lines
2018-11-27 11:23:12.320 5084-5111/com.platinum D/EGL_emulation: eglMakeCurrent: 0x7c2d1d4fa220: ver 3 0 (tinfo 0x7c2d24e23bc0)
2018-11-27 11:23:12.675 5084-5111/com.platinum D/EGL_emulation: eglMakeCurrent: 0x7c2d1d4fa220: ver 3 0 (tinfo 0x7c2d24e23bc0)

I dont want to see such logs, I dont care about D/EGL_emulation. I would like to see only my logs, which are belongs to my application's development. I don't want to see any log from Android OS, or about any hardware functionings, or etc.

Thanks in advance


Solution

  • Doesn't depend on the TAG?

    I also faced this issue and wrote a global tag to provide with my logs.

    Then I am filtering this tag (in case of Android Studio).