Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
204 views
in Technique[技术] by (71.8m points)

android - Filtering Logcat Logs on commandline

public static final TAG = "Legendry Eagle";

Issue: I want to see logs of "Legendry Eagle" from the commandline.

I tried:

 adb logcat -s "Legendry Eagle" 
 adb logcat -s <Legendry Eagle>

But Still it is not working.

question from:https://stackoverflow.com/questions/13931729/filtering-logcat-logs-on-commandline

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

If you only want to show logcat for a specific TAG, do it like this:

adb logcat YourTAGHere:Priority *:S

The *:S is important, as it sets all other tags to silent. If I want to track only my MainActivity tag at Verbose level, the syntax would look like this.

adb logcat MainActivity:V *:S

Edit: I found no good way of filtering out tags with spaces. LegendryEagle works fine, but I was not able to filter out Legendry Eagle


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...