65

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).

what I hope is I can disable (exclude) Log Tag from libraries used in my project.

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)

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.

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

Community
  • 1
  • 1
myNameCoad
  • 2,583
  • 2
  • 12
  • 15
  • 1
    Related post - [How to exclude certain messages by TAG name using Android adb logcat?](https://stackoverflow.com/q/5511433/465053) – RBT Aug 28 '18 at 00:11
  • Does this answer your question? [How to exclude certain messages by TAG name using Android adb logcat?](https://stackoverflow.com/questions/5511433/how-to-exclude-certain-messages-by-tag-name-using-android-adb-logcat) – slhck Nov 22 '22 at 07:34

3 Answers3

176

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

here it is: How to exclude certain messages by TAG name using Android adb logcat?

for android studio users

go to Logcat console > Edit Filter Configuration > Log Tag(regex) and put this instead

^(?!(EXCLUDE_TAG1|EXCLUDE_TAG2))

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


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
Someone Somewhere
  • 23,475
  • 11
  • 118
  • 166
myNameCoad
  • 2,583
  • 2
  • 12
  • 15
  • How do you find this? I'm at the logcat tab of Android Monitor, but I don't see "Edit Filter Configuration" anywhere. I'm running Android Studio 2.2.3 – LarsH Feb 21 '17 at 14:37
  • 2
    Never mind, I found it ... it's one of the options on the dropdown on the far right. The dropdown may show "No Filters", "Show only selected application", etc. Poor UI design that one of these options pops up a settings dialog! – LarsH Feb 21 '17 at 14:40
  • 2
    This seems to disable "Show only selected application", which floods the log with way too many things. I had to manually add _my.package.name_ to "Package Name" without Regex. – FirstOne May 10 '18 at 17:31
  • @FirstOne Add your package name in `Package Name:` of the `Edit Filter Configuration `. – Prateekro Nov 18 '20 at 20:13
  • Any regex for both include and exclude tag – Shubham AgaRwal Dec 29 '20 at 09:01
  • I found it's possible to add as many exclusions as you like just by keeping on adding `|EXCLUSION_TAGx` behind the last one. – Someone Somewhere Sep 09 '21 at 19:25
  • @Killer it doesn't make sense to have include and exclude in one regex, so I updated the answer with the "exclude all, except" approach. – Someone Somewhere Sep 09 '21 at 20:04
6

With the new Android Studio Logcat, you can do it using the following filter:

-tag:tag_to_exclude

This is per the documentation:

Negation is expressed by prepending a - to the field name. For example, -tag:MyTag matches log entries whose tag doesn't contain the string MyTag.

boltup_im_coding
  • 6,345
  • 6
  • 40
  • 52
Mohamed Medhat
  • 761
  • 11
  • 16
0

For example if you want to exclude "native", enter ^(?!(native|FEngine)) in "Log Tag: " and check Regex

enter image description here

Booo
  • 71
  • 1
  • 6