Android-没有调试日志的ADB Logcat [英] Android - adb logcat without debug logs

查看:84
本文介绍了Android-没有调试日志的ADB Logcat的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不想通过 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:

日志消息的标签是一个短字符串,指示消息所源自的系统组件(例如,对于视图系统,为"View").

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:详细(最低优先级)
  • 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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆