Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to exclude Log Tag in 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).

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

like image 278
myNameCoad Avatar asked Apr 14 '15 04:04

myNameCoad


People also ask

What is regex in Logcat?

regexp,AndroidStudio,logcat. Logcat provides several default filter options (Verbose, Info, Debug etc) and a simple pattern match filter, but the regex filter is the most powerful option for customizing logcat output.

What is verbose Logcat?

Logcat is a command-line tool that dumps a log of system messages, including stack traces when the device throws an error and messages that you have written from your app with the Log class. This page is about the command-line logcat tool, but you can also view log messages from the Logcat window in Android Studio.

How do I stop Logcat from clearing?

Prevent clearing the log when the app crashes By default when the app got crashed the logcat clear's in the android studio. To prevent this, click the right end chooser(Filter Configuration chooser) in the logcat tab then select Edit Filter Configuration option and enter current app name and package name.


1 Answers

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 
like image 94
myNameCoad Avatar answered Sep 19 '22 15:09

myNameCoad