Reputation: 2093
I'm trying to filter logcat output from a real device (not an emulator) by tag name but I get all the messages which is quite a spam. I just want to read messages from browser which should be something like "browser:" or "webkit:" , but it doesn't work... Here it is what I get:
Upvotes: 172
Views: 184615
Reputation: 179
Here is how I create a tag:
private static final String TAG = SomeActivity.class.getSimpleName();
Log.d(TAG, "some description");
You could use getCannonicalName
Here I have following TAG filters:
Here what I type in terminal:
$ adb logcat *View:V *Activity:V Xyz*:E System.out:S
Upvotes: 9
Reputation: 21617
Do not depend on ADB shell, just treat it (the adb logcat) a normal linux output and then pip it:
$ adb shell logcat | grep YouTag
# just like:
$ ps -ef | grep your_proc
Upvotes: 9
Reputation: 47319
Another option is setting the log levels for specific tags:
adb logcat SensorService:S PowerManagerService:S NfcService:S power:I Sensors:E
If you just want to set the log levels for some tags you can do it on a tag by tag basis.
Upvotes: 16
Reputation: 761
In case someone stumbles in on this like I did, you can filter on multiple tags by adding a comma in between, like so:
adb logcat -s "browser","webkit"
Upvotes: 76