码迷,mamicode.com
首页 > 移动开发 > 详细

【Android】logcat日志信息过滤

时间:2015-03-18 10:40:29      阅读:421      评论:0      收藏:0      [点我收藏+]

标签:

原文:http://stackoverflow.com/questions/5511433/how-to-exclude-certain-messages-by-tag-name-using-android-adb-logcat


down voteaccepted

If you are using adb logcat you could pipe it through grep and use it‘s inverted matching: From the grep manpage:

v, --invert-match Invert the sense of matching, to select non-matching lines.

For example:

$adb logcat | grep --invert-match ‘notshownmatchpattern‘ 

You can extend this by using regular expressions.

Here is an example of such an expression:

"/^(?:emails|tags|addresses)"

This one would check for either of the given to occur, grep would then not list them.


过滤出指定tag的日志信息

^(?:tag1|tag2|tag3)


忽略指定tag的日志信息

^(?!tag1|tag2|tag3)


比如,我想忽略掉Tag中包含"SurfaceTextureClient"或"Trace"的日志信息,可以在过滤器的by Log Tag选项中配置"^(?!SurfaceTextureClient|Trace)"

技术分享


【Android】logcat日志信息过滤

标签:

原文地址:http://blog.csdn.net/linchaolong/article/details/44402347

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!