默认的eclipse logcat窗口包含VM中的大量控制台垃圾邮件等。如何删除这些消息?现在,现在唯一的过滤器是为过滤 ,而不是过滤量 spam。
另外,如果要过滤您对自己不感兴趣的日志消息,则可以使用LogCat的" Filter_spec"的静音选项。
例如,如果要过滤dalvik vm的日志杂物,例如
d/dalvikvm(28039):GC_Concurrent Freed 473K,7%免费9503K/10180K,暂停2ms 3ms,总计22ms
然后您可以使用
adb logcat dalvikvm:S
这是从开发人员页面 - logcat:
来定义的LogCat
logcat
The Android logging system provides a mechanism for collecting and viewing system debug
output. Logs from various applications and portions of the system are collected in a
series of circular buffers, which then can be viewed and filtered by the logcat command.
You can use logcat from an ADB shell to view the log messages.
好吧,您可以通过标签,按进程ID,字符串或表达式进行过滤来获取所需的东西。无论如何,如果您对Logcat
不太熟悉,请先尝试本指南 - 了解如何控制LogCat Output
一个选项是使用命令行。
appname=YOUR_APP_NAME_OR_LOG_TAG
adb logcat | awk '/'$appname'/{gsub(/'$appname'/, "x1b[95m'$appname'x1b[0m"); print; next}; /(dalvikvm|com.google.android.apps|PhoneStatusBar|DeviceConfig)/{next}; {print}'
这将突出显示您的应用程序的名称,删除包含垃圾邮件的消息的消息,然后打印任何知识。