Logcat debug level --help

4,332 views
Skip to first unread message

Yash Jain

unread,
Apr 7, 2011, 9:12:48 AM4/7/11
to android-...@googlegroups.com, android-d...@googlegroups.com
Hello All,
I have one dumb question,
when i read a logcat message through command logcat -d, i will get a list of all events with the prefix I, V, D, W, and E which represent Information, Verbose, Debug, Warning and Error.
I am interested only to display the error messages in the log file( logcat -f log_error.txt) or to the console( logcat -d).
Can anyone help me to print only the error log messages.

Thanks in advance.

Regards,
Yash Jain.

Ashutosh Deshmukh

unread,
Apr 7, 2011, 11:32:35 AM4/7/11
to android-platform
There is DDMS tool which is part of Android SDK, which allows creating
the Filter for logcat messages using the Error Log level.
The procedure is straight forward...
1. Start the DDMS
2. Once it is launched, one can see the "+" sign in Green color, to
add the Filter.
3. After clicking the "+" sign, a small window will pop up, named Log
Filter,
4. Just specify any user-chosen name for filter, and then Select the
Option, by Log Level.
5. Choose the appropriate log level such as Error, Warning.

Hope this helps...


On Apr 7, 9:12 am, Yash Jain <yash2le...@gmail.com> wrote:
> Hello All,
> I have one dumb question,
> when i read a logcat message through command logcat -d, i will get a list of
> all events with the prefix I, V, D, W, and E which represent *I*nformation,
> *V*erbose, *D*ebug, *W*arning and *E*rror.

Skyler Kaufman

unread,
Apr 7, 2011, 11:07:00 AM4/7/11
to android-...@googlegroups.com, Yash Jain, android-d...@googlegroups.com
Hello Yash :)

You can pass logcat a filter specifying which level of event to show, in the form tag:priority, where the priority is given as the single letter prefix you have mentioned. Sounds like you don't want to specify a tag, so you can just use * (all tags). For example, to show only error messages:

$ logcat *:E



~skyler

--
You received this message because you are subscribed to the Google Groups "android-platform" group.
To post to this group, send email to android-...@googlegroups.com.
To unsubscribe from this group, send email to android-platfo...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/android-platform?hl=en.

Yash Jain

unread,
Apr 12, 2011, 1:46:50 AM4/12/11
to Skyler Kaufman, michae...@gmail.com, android-...@googlegroups.com, android-d...@googlegroups.com
Hello All,
Thanks for your inputs, Filtering of log message helped me lot to debug.

Regards,
Yash.


---------- Forwarded message ----------
From: Michael <michae...@gmail.com>
Date: Thu, Apr 7, 2011 at 7:01 PM
Subject: [android-developers] Re: Logcat debug level --help
To: Android Developers <android-d...@googlegroups.com>


try adb logcat *:e
Reply all
Reply to author
Forward
0 new messages