Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Filter for multiple tags in LogCat in Android Studio?

I'd like to filter my LogCat based on multiple TAG, How can I achieve this? Should I use Regex in order to filter by multiple TAG?

For example, I have this two lines of code which are used in my codes:

private static final String TAG1 = "My TAG 1";
private static final String TAG2 = "My TAG 2";

Can I filter out the LogCat to show both of them in the result?

like image 728
Ahmad Payan Avatar asked Aug 19 '17 04:08

Ahmad Payan


People also ask

How do I filter the LogCat output in Android Studio?

To get the most out of your application, Logcat has several levels of log messages, so Android Studio provides multiple ways of filtering the logcat output. One method is to use the Log Level dropdown menu, to filter based on log level, open this dropdown and select anything other than the default Verbose option.

How do I use Android app tags with logcat?

Every Android log message includes a tag. You can use these tags with filters defined in Logcat. To open Logcat pane, click "Show only selected application" drop-down menu from the top right and select "Edit Filter Configuration". This opens a "Create New Logcat Filter" dialog:

How to filter logcat output by tag and priority level?

You can filter logcat output by tag and priority level. An entry in logcat is registered by calling one of the methods of the Log class. The called method defines the priority level ( Log.i() , Log.e() , etc) being the tag defined by the string passed to the first parameter :

How do I create an application filter in logcat?

Log cat has a new option (on by default) which creates an application filter automatically such that only the launched application's output is shown There are two ways to do this, both are in the Android tab at the bottom of the IDE (where the logcat output is displayed).


1 Answers

You can do this by enabling regex and entering:

(My TAG 1)|(My TAG 2)
like image 159
Veneet Reddy Avatar answered Nov 10 '22 14:11

Veneet Reddy