I have developed an Android application that performs some network activity. Inside the classes I have implemented the log messages like verbose, debug, info, warn and error. But when I open logcat with argument -d its listing the entire log messages from the device. So its difficult to trace the log messages of my application. Is there any way to filter the log messages of my application from the entire logcat output?
I have developed an Android application that performs some network activity. Inside the classes
Share
Every Android log message has a tag and a priority associated with it:
Here’s how to do it:
This will make logs with the tag ActivityManager show up if they have an “Info” level priority or above (Warning, Error, Fatal). The same applies to messages with the tag MyApp and a priority of Debug or above. *:S makes all other messages be silent.
Check this out in the documentation: http://developer.android.com/guide/developing/tools/adb.html#logcat
Further tips
I suggest you to keep all other logs to Error or Warning level (
*:W). Sometimes you get a problem in your application due some system event or third party application and you do want to be notified of these events!You might want to change the output format of logcat. Play around with these settings (information in the same link above)
You might want to check out Coloured output for logcat. I’ve done some modifications to this script to suit better my needs so maybe you could adjust it too. (I tried to send my modifications to the author but he didn’t reply).