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?
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.
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:
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 :
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).
You can do this by enabling regex and entering:
(My TAG 1)|(My TAG 2)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With