Filter tags in LogCat (in Android Eclipse Plug-In)
Solution 1
There's a button that looks like a green + in the upper right of the log cat window, if you mouse over it says "Create Filter" in the popup from that you can filter by log tag. It creates a new tab in log cat with the filter name you specified. Then all of the output of that tag will go to that tab and not the "Log" tab.
Solution 2
In Eclipse, if I would like to exclude those annoying Choreographer messages,I write this filter in the logcat filter TextField : tag:^(?!Choreographer).*$
and it excludes all messages which tag starts with the text Choreographer
If you want multiple exclusions : tag:^(?!Choreographer|dalvikvm-heap|Trace).*$
Solution 3
The Log tag
field accepts Java regular expressions, so try this:
^TAG_A$|^TAG_B$
which matches exactly those tags. You can go crazy with complicated regular expressions, if that's your idea of fun.
Solution 4
Old question, but still relevant, and didn't see this answer among the answers here.
To filter by multiple columns in logcat textfield, simply use a space
between regular expressions, and the column title in lower case followed by :
to assign the regex to that column instead of the default "text:"
for example:
tag:wif text:event
a space '' is used as an AND argument.
a single '|
' without space is an OR.
Regarding one of the comments I've seen here - There is no realy need for a wildcard, since it is automatically applied before and after the filter text.
If you don't want wildcard, you can use regular expression syntax to restrict the string.
for example: ^starswith
or fullword$
TIP: if you want to match a space character or a tab in your output, just type in: \s
at the desired place.
Solution 5
When filtering, you must use no whitespace after 'tag:' and all is case sensitive. For example:
tag:MIRKO
and not
TAG: mirko
OneWorld
Updated on June 11, 2020Comments
-
OneWorld almost 4 years
There is a TextField "Filter" below the LogCat output. However, it seems to filter only the Message-column. Id like to filter Tags also. Because there are my class names.
How can I achieve it?
-
OneWorld over 13 yearsCan't use wildcards like "com.mynamespace.*" ;( But thanks for showing me that function ;)
-
OneWorld over 13 yearsCould you provide the commands how to pipe it in the shell? Sorry, I grew up with OS using GUI and have no clue on those things...
-
Chris Stratton over 13 yearsadb logcat | grep someNameOfInterest you can also use the -i flag to make it case insensitive. Oh, and you have to have grep, ie, be on linux or unix or cygwin or msys or have a grep executable for your OS.
-
Matt Connolly almost 13 yearsI'd really like to be able to use wildcards in here too.
-
Admin over 12 yearsWoah great, I never noticed that. Welcome to StackOverflow!
-
Shine almost 12 yearsThis seems to be working only in ADT, since if I use it programatically (Runtime.getRuntime().exec("logcat [<option>] ... [<filter-spec>] ...")), it doesn't work.
-
peedee about 9 yearsthanks for the tip with the whitespace \s that is exactly what I was looking for