问题描述
我不想通过 adb logcat
命令查看调试日志.我的手机中有大量调试日志,我不想看到它们.
I don't want to see debug logs from adb logcat
command. There are tons of debug logs from my phone and I don't want to see them.
adb logcat --help
说"*:我
仅输出信息日志,但除了调试以外,是否有其他选项可以过滤所有日志.
adb logcat --help
says " *:I "
will output only info logs but is there any option to filter all logs except debug.
推荐答案
来自此处的文档,当您指定日志级别过滤器时,它将显示该级别及更高级别的所有消息.级别指定为:
From the docs here, when you specify a log level filter, it will show all messages at that level and higher. The levels are specified as:
优先级是以下字符值之一,按从低到高的顺序排列:
The priority is one of the following character values, ordered from lowest to highest priority:
- V:详细(最低优先级)
- D:调试
- 我:信息
- W:警告
- E:错误
- F:致命
- S:无声(最高优先级,从未打印过任何内容)
...
以下过滤器表达式在所有标签上显示优先级为警告"或更高的所有日志消息:
The following filter expression displays all log messages with priority level "warning" and higher, on all tags:
adb logcat *:W
因此,考虑到这一点,通过您提到的 *:I
过滤器将记录除Verbose和Debug日志以外的所有内容.
So with this in mind, passing the filter you mentioned *:I
will log everything but Verbose and Debug logs.
除非您打算显示Verbose以及其他日志级别,否则我认为您不能这样做,因为指定Verbose包括高于Verbose的任何内容.
Unless your intention is to show Verbose as well as the other log levels, I don't think you can do that because specifying Verbose includes anything above Verbose.
在这种情况下,对特定标签(而不是特定日志级别或两者的某种组合)进行过滤可能会很有用.
If that is the case, it might be useful for you to filter on a specific tag instead of a specific log level, or some combination of both.
这篇关于Android-没有调试日志的ADB Logcat的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!