Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Handling spaces in logcat

Tags:

android

logcat

One of the external libraries that my app uses have spaces in its logcat tag:

Log.d("Some External Library", "Debug Message");

How do I write the filter-spec in the logcat command to handle spaces? Logcat inside eclipse was able to filter it but I prefer the command line.

I've tried the following and they don't work:

adb logcat -s "Some External Library"
adb logcat -s Some\ External\ Library
adb logcat -s Some External Library
like image 635
Rollin_s Avatar asked Feb 11 '11 16:02

Rollin_s


1 Answers

So my advice would be to use an pipe. Write:

adb logcat | grep 'Some External Library'

Maybe someone else has another idea.

If you need only debug messages write adb logcat '*:D' | grep 'Some External Library' for more possible tags write adb logcat --help

The problem with this is, you can't use this solution in an adb shell environment, because the file-system there is read-only. But this solution should give you more or less the results you want.

Commands like adb logcat -s 'Some External Library' or logcat -s '"Some External Library":D' are not working.

like image 67
Darokthar Avatar answered Sep 29 '22 04:09

Darokthar