如何在 logcat Android Studio 中排除日志标签? [英] How to exclude Log Tag in logcat Android Studio?

查看:29
本文介绍了如何在 logcat Android Studio 中排除日志标签?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不确定以前是否有人问过这种问题(我用谷歌搜索过,但没有找到解决问题的正确方法).

I'm not sure if this kind of question been asked before (I did Google it but not found the proper way to solve my question).

我希望我可以从我的项目中使用的库中禁用(排除)日志标签.

我尝试进入 Logcat 控制台 > 编辑过滤器配置 > 日志标签(正则表达式) 但在这里我每次创建它时都必须添加新的日志标签.(这种方式不会在我的 logcat 中显示任何异常)

I tried to go in Logcat console > Edit Filter Configuration > Log Tag(regex) but here I have to add new Log Tag every time I create it. (and this way will not show any exception in my logcat)

同本主题如何在Android Studio中过滤logcat? 我按照@dmsherazi 的建议选择了选择正在运行的进程,但我仍然可以从库中看到很多日志标记.

Same as this topic How to filter logcat in Android Studio? I selected select the process running as @dmsherazi suggest but I still can see lots of log tag from libraries.

那么,有没有办法在 android studio 中排除特定的日志标签(我使用的是 v1.2 beta3)?

So, is there a way to exclude specific log tag in android studio (I'm using v1.2 beta3)?

推荐答案

很抱歉在 20 分钟的提问后回答了我自己的问题.我的朋友刚刚给我发了一个链接来解决我的问题

I'm sorry for answering my own question after 20 minutes of asking. My friend just sent me a link that solves my question

这里是:如何使用 Android adb logcat 按 TAG 名称排除某些消息?

安卓工作室用户

转到 Logcat 控制台 >编辑过滤器配置 >日志标签(正则表达式) 和把这个代替

^(?!(EXCLUDE_TAG1|EXCLUDE_TAG2))

请注意,EXCLUDE_TAG1 和 EXCLUDE_TAG2 是您从 logcat 中排除的日志标签.

note that EXCLUDE_TAG1 and EXCLUDE_TAG2 are Log Tag you exclude from logcat.

另一种回答问题的方法是排除所有,除了...阻止显示所有标签,INCLUDE_TAG 除外

Another way to answer the question is to exclude all, except ... To block all tags from showing up, except INCLUDE_TAG

(?:INCLUDE_TAG) for one tag
(?:(INCLUDE_TAG1|INCLUDE_TAGx)) for multiple tags

这篇关于如何在 logcat Android Studio 中排除日志标签?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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