Controlling Log Output Format

Log messages contain a number of metadata fields, in addition to the tag and priority. You can modify the output format for messages so that they display a specific metadata field. To do so, you use the -v option and specify one of the supported output formats listed below.

• brief — Display priority/tag and PID of originating process (the default format).

• thread — Display process:thread and priority/tag only.

• raw — Display the raw log message, with no other metadata fields.

• time — Display the date, invocation time, priority/tag, and PID of the originating process.

• long — Display all metadata fields and separate messages with a blank lines.

When starting logcat, you can specify the output format you want by using the -v option:

Here's an example that shows how to generate messages in thread output format:

adb logcat -v thread

Note that you can only specify one output format with the -v option. Viewing Alternative Log Buffers

The Android logging system keeps multiple circular buffers for log messages, and not all of the log messages are sent to the default circular buffer. To see additional log messages, you can start logcat with the -b option, to request viewing of an alternate circular buffer. You can view any of these alternate buffers:

• radio — View the buffer that contains radio/telephony related messages.

• events — View the buffer containing events-related messages.

The usage of the -b option is:

Here's an example of how to view a log buffer containing radio and telephony messages:

adb logcat -b radio

0 0

Post a comment