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

4

10

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?

Moo answered 27/10, 2015 at 11:17 Comment(1)
thanks for answers, Creating a new Filter with pipe symbol ' | ' (to separate tags) will do the job however I am more interested to know without creating a new filter (which has both tags) is there anyway to just display result of two filters on fly Without creating a brand new filter? something like command line in search box , perhaps a something like Linux comand line : adb logcat | grep -e book -e penMoo
U
20

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 |

Unlikelihood answered 27/10, 2015 at 11:30 Comment(1)
This answer was very close to what I was looking for however if you really want to know how to do this without creating a new filter then see my response.Moo
M
6

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

Moo answered 27/10, 2015 at 12:45 Comment(0)
C
1

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
Crucify answered 27/10, 2015 at 11:29 Comment(0)
B
0

Have you tried separating both values by coma or semi-colon or |?

LOG TAG: pen, book

or

LOG TAG: pen; book

or

LOG TAg: pen|book

Blackbird answered 27/10, 2015 at 11:20 Comment(1)
thanks for answer, Creating a new Filter with pipe symbol ' | ' (to separate tags) will do the job however I am more interested to know without creating a new filter (which has both tags) is there anyway to just display result of two filters on fly Without creating a brand new filter?Moo

© 2022 - 2024 — McMap. All rights reserved.