Logcat filtration and common usage finishing

Source: Internet
Author: User
Tags print format

Usage: logcat [Options] [Filterspecs]


Options include:
-S Set default filter to silent.
Like specifying Filterspec ' *:s '
-F <filename> Log to file. Default to stdout
-R [<kbytes>] Rotate log every kbytes. (if unspecified). Requires-f
-N <count> sets max number of rotated logs to <count>, default 4
-M <1,0> Set enable copy (Move) the log to Oms_log_path
-V <format> sets the log print format, where <format> is one of:

Brief process Tag thread raw time ThreadTime long

-C Clear (flush) the entire log and exit
-D Dump the log and then exit (Don ' t block)
-G get the size of the log ' s ring buffer and exit
-B <buffer> request alternate ring buffer
(' main ' (default), ' Radio ', ' Events ')
-B Output the log in binary


Filterspecs is a series of
<tag>[:p Riority]

Where <tag> is a log component tag (or * for all) and the IS:
V Verbose
D Debug
I Info
W Warn
E Error
F Fatal
S Silent (supress all output)

' * ' means ' *:d ' and <tag> by itself means <tag>:v

If not specified on the commandline, Filterspec are set from Android_log_tags.
If no filterspec is found, filter defaults to ' *:i '

If not specified WITH-V, format was set from Android_printf_log
or defaults to "brief"

Example:

    1. See radio log
      logcat-b Radio

      i/rilc    (  ): 0d 0a
      i/ rilc    (  ): at[0]< +ecind:1,16,99
      i/rilc    (  ): at[ 0]< +ecsq:16,99
      i/rilc    (  ): <<<< pch[0] ...
      i/rilc    (  ): 0d 0a 2b (43) 4e 45 3a + 2c-53 2c, 0d, 0a 0d 0a 2b---------- 3a 2c i/rilc    (  ): 0d 0a
      i/rilc    (   46 ): at[0]< +ecind:1,17,99
      i/rilc    (  ): at[0]< +ecsq:17,99
    2. View logs above warning
      Logcat *:w

      E/sensormanager (102): smjni------JNI data_open
      e/         (  ): b433 6155
      e/         (  ): b433 6157
      E/gralloc (102): [unregister] handle 0x2debd0 still lock
      W/batteryservice (102) : Get battery health[0] ' charging '
      W/batteryservice (102): Get battery health= ' good '
      W/batteryservice (102): Get BA Ttery health[0] ' charging '
      W/batteryservice (102): Get battery health= ' good '
    3. filter to view DALVIKVM's log
      logcat-s dalvikvm or logcat dalvikvm *:s

      d/ DALVIKVM (257): GC freed 1191 objects/343344 bytes in 65ms
      D/DALVIKVM (257): GC freed 1191 objects/343400 bytes in 64ms
      D/DALVIKVM (257): GC freed 1191 objects/343368 bytes in 65ms
      D/DALVIKVM (257): GC Freed 1191 objects/343416 Bytes in 70ms
      D/DALVIKVM (257): GC freed 1191 objects/343384 bytes in 64ms

      Remarks: Logcat is a bit of a weird way of filtering, not directly referring To filter the tag and specify priority on the line, you must set all the silent, on this basis, set the tag filter to succeed.
      Therefore, the Logcat Appname:v cannot successfully filter the log.
    4. Filter logs from multiple apps
      Logcat-s DALVIKVM Vold

      D/vold (+): door_sock=10
      D/vold (+): fw_sock=7
      D/vold (+): uevent_sock=6
      D/DALVIKVM (257): GC freed 1191 objects/343384 bytes in 76ms
      D/DALVIKVM (257): GC freed 1191 objects/343368 bytes in 81ms
      D/DALVIKVM (257): GC freed 1191 objects/343400 bytes in 64ms
      D/vold (+): Select Result=1
    5. Log saved to file
      Logcat > 1.txt (">" is the Data Flow guide symbol for Windows)

      Try the-f option and the result is an error.
      Logcat-f 1.txt
      Couldn ' t open output file:read-only file system

Logcat filtration and common usage finishing

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.