我不想看到 adb logcat
命令的调试日志。我的手机有大量调试日志,我不想看到它们。
adb logcat --help
说 "*:I "
将只输出信息日志,但是否有任何选项可以过滤除调试之外的所有日志。
最佳答案
来自 docs here ,当您指定日志级别过滤器时,它将显示该级别及更高级别的所有消息。级别指定为:
The tag of a log message is a short string indicating the system component from which the message originates (for > example, "View" for the view system).
The priority is one of the following character values, ordered from lowest to highest priority:
- V: Verbose (lowest priority)
- D: Debug
- I: Info
- W: Warning
- E: Error
- F: Fatal
- S: Silent (highest priority, on which nothing is ever printed)
...
The following filter expression displays all log messages with priority level "warning" and higher, on all tags:
adb logcat *:W
因此,考虑到这一点,传递您提到的过滤器 *:I
将记录除 Verbose 和 Debug 日志之外的所有内容。
除非您的 Intent 是显示 Verbose 以及其他日志级别,否则我认为您不能这样做,因为指定 Verbose 包括 Verbose 之上的任何内容。
如果是这种情况,对特定标签而不是特定日志级别或两者的某种组合进行过滤可能对您有用。
关于Android - 没有调试日志的 adb logcat,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11009062/