我想让我的 logcat 只打印我想通过调用 看到的数据
Log.i(...)
但是, logcat 将所有内容都吐到我的日志 中,而我 厌倦了在每次 我打开一个项目时使用无休止的正则表达式或标签过滤信息。
是否有 简单可靠的解决方案 ?
例如:
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)
我不想看到这样的日志,我不在乎 D/EGL_emulation。我只想查看属于我的应用程序开发的日志 。 我不想看到来自 Android 操作系统的任何日志,或关于任何硬件功能等。
提前致谢
最佳答案
不依赖于TAG?
我也遇到了这个问题, 写了一个全局标签 来提供我的日志。
然后我过滤这个标签(在 Android Studio 的情况下)。
关于android - 如何说服 Logcat 只打印有值(value)的数据,并防止呕吐无用的垃圾邮件日志,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/53497709/