Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to display two or more logcat filters at the same time in Android Studio?

I have declared two LOG.i such as followings in my code:

Log.i("pen", pen.toString);
Log.i("book", book.toString);

Then I added these two filters to my Logcat window (via Edit Filter Configuration):

Filter1 with 'LOG TAG' set to pen Filter2 with 'LOG TAG' set to book

I have no problem to see them each individually (by selecting them each in drop-down filter in logcat window).

NOW What I need to know is HOW to display both filters at the same time?

like image 316
bastami82 Avatar asked Oct 27 '15 11:10

bastami82


People also ask

What is verbose Logcat?

Verbose: Show all log messages (the default). Debug: Show debug log messages that are useful during development only, as well as the message levels lower in this list. Info: Show expected log messages for regular usage, as well as the message levels lower in this list.

What is chatty in Logcat?

As soon as app considered 'chatty' by logcat (more than 5 lines per second), logs of your app will be collapsed. You can avoid this behaviour by whitelisting your app for logcat: adb logcat -P '<pid or uid of your app>'

What is Logcat buffer?

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.


3 Answers

Have you tried using regex? Do as the screenshot below and you should see both tags at the same time

enter image description here

For copy/paste: (pen|book)

Note this accepts any number of tags as long as you separate them with |

like image 158
Edson Menegatti Avatar answered Oct 26 '22 17:10

Edson Menegatti


Thanks for all responses, they all were really helpful, however I found what I was looking for, if you really do not want to create a new filter just copy and paste something similar (pen|book) to the Search box on the main logcat window and do not forget to tick Regex box next to it. enter image description here

like image 45
bastami82 Avatar answered Oct 26 '22 18:10

bastami82


Via the Edit filter configuration, create or edit a filter with Log Tag(regex) (or check regex depending on the version of android studio) set to

pen|book

I can not take a screenshot now, I'm sorry.

Otherwise using the command line you can do (on linux)

adb logcat | grep -e book -e pen
like image 28
ThomasThiebaud Avatar answered Oct 26 '22 19:10

ThomasThiebaud