android logcat

adb -s 8e3ee4659904 shell logcat --h
Option -m needs an argument
Usage: logcat [options] [filterspecs]
options include:
  -s              Set default filter to silent. Equivalent to filterspec '*:S'
  -f <file>, --file=<file>               Log to file. Default is stdout
  -r <kbytes>, --rotate-kbytes=<kbytes>
                  Rotate log every kbytes. Requires -f option
  -n <count>, --rotate-count=<count>
                  Sets max number of rotated logs to <count>, default 4
  -v <format>, --format=<format>
                  Sets the log print format, where <format> is:
                    brief color epoch long monotonic printable process raw
                    tag thread threadtime time uid usec UTC year zone
  -D, --dividers  Print dividers between each log buffer
  -c, --clear     Clear (flush) the entire log and exit
                  if Log to File specified, clear fileset instead
  -d              Dump the log and then exit (don't block)
  -e <expr>, --regex=<expr>
                  Only print lines where the log message matches <expr>
                  where <expr> is a regular expression
  -m <count>, --max-count=<count>
                  Quit after printing <count> lines. This is meant to be
                  paired with --regex, but will work on its own.
  --print         Paired with --regex and --max-count to let content bypass
                  regex filter but still stop at number of matches.
  -t <count>      Print only the most recent <count> lines (implies -d)
  -t '<time>'     Print most recent lines since specified time (implies -d)
  -T <count>      Print only the most recent <count> lines (does not imply -d)
  -T '<time>'     Print most recent lines since specified time (not imply -d)
                  count is pure numerical, time is 'MM-DD hh:mm:ss.mmm...'
                  'YYYY-MM-DD hh:mm:ss.mmm...' or 'sssss.mmm...' format
  -g, --buffer-size                      Get the size of the ring buffer.
  -G <size>, --buffer-size=<size>
                  Set size of log ring buffer, may suffix with K or M.
  -L, -last       Dump logs from prior to last reboot
  -b <buffer>, --buffer=<buffer>         Request alternate ring buffer, 'main',
                  'system', 'radio', 'events', 'crash', 'default' or 'all'.
                  Multiple -b parameters or comma separated list of buffers are
                  allowed. Buffers interleaved. Default -b main,system,crash.
  -B, --binary    Output the log in binary.
  -S, --statistics                       Output statistics.
  -p, --prune     Print prune white and ~black list. Service is specified as
                  UID, UID/PID or /PID. Weighed for quicker pruning if prefix
                  with ~, otherwise weighed for longevity if unadorned. All
                  other pruning activity is oldest first. Special case ~!
                  represents an automatic quicker pruning for the noisiest
                  UID as determined by the current statistics.
  -C              colored output
  -P '<list> ...', --prune='<list> ...'
                  Set prune white and ~black list, using same format as
                  listed above. Must be quoted.
  --pid=<pid>     Only prints logs from the given pid.
  --wrap          Sleep for 2 hours or when buffer about to wrap whichever
                  comes first. Improves efficiency of polling by providing
                  an about-to-wrap wakeup.

filterspecs are a series of 
  <tag>[:priority]

where <tag> is a log component tag (or * for all) and priority is:
  V    Verbose (default for <tag>)
  D    Debug (default for '*')
  I    Info
  W    Warn
  E    Error
  F    Fatal
  S    Silent (suppress all output)

'*' by itself means '*:D' and <tag> by itself means <tag>:V.
If no '*' filterspec or -s on command line, all filter defaults to '*:V'.
eg: '*:S <tag>' prints only <tag>, '<tag>:S' suppresses all <tag> log messages.

If not specified on the command line, filterspec is set from ANDROID_LOG_TAGS.

If not specified with -v on command line, format is set from ANDROID_PRINTF_LOG
or defaults to "threadtime"
 

adb -s 8e3ee4659904 shell logcat—h
选项m需要一个参数
用法:logcat[选项][filterspecs]
选项包括:
-s设置默认过滤器为静音。相当于filterspec '*:S'
-f <file>,——file=<file> Log to file。默认是stdout
- r < kbytes >,rotate-kbytes = < kbytes >
每千字节旋转日志。需要- f选项
- n <统计>,rotate-count = <统计>
设置旋转日志的最大数量为<count>,默认值为4
- v <格式>,格式= <格式>
设置日志打印格式,其中<format>为:
简单的颜色历元长单调的可印刷工艺
标签线程线程时间uid usec UTC年区
-D,——分隔符在每个日志缓冲区之间打印分隔符
清除(刷新)整个日志并退出
如果指定了Log to File,则清除fileset
-d转储日志,然后退出(不要阻塞)
- e < expr >,regex = < expr >
只打印日志消息匹配<expr>的行
<expr>在哪里是正则表达式
- m <统计>,max-count = <统计>
打印<count>行后退出。这是注定的
与-regex配对,但将自行工作。
-打印匹配-regex和-max-count,让内容绕过
regex过滤器,但仍然停留在匹配的数量。
-t <count>仅打印最近的<count>行(暗示-d)
-t '<time>'打印自指定时间以来的最新行(暗示-d)
-T <count>仅打印最近的<count>行(并不表示-d)
-T '<time>'打印自指定时间以来的最新行(不含-d)
计数是纯粹的数字,时间是' mm - dd hh:mm:ss.mmm…
“YYYY-MM-DD hh:mm:ss.mmm……”或“sssss.mmm……的格式
-g, -buffer-size获取循环缓冲区的大小。
- g <大小>,缓冲区大小= <大小>
设置日志环缓冲区的大小,可以以K或M为后缀。
-L, -上次重新引导之前的转储日志
-b <buffer>, -buffer=<buffer>请求备用循环缓冲区,'main',
“系统”、“广播”、“事件”、“崩溃”、“默认”或“全部”。
多个-b参数或逗号分隔的缓冲区列表是
允许的。缓冲区交错。默认- b主要、系统崩溃。
-B, -二进制输出以二进制表示的对数。
-S,——统计数据输出统计数据。
-p, -修剪印刷,修剪白色和黑色列表。服务被指定为
UID, UID/PID或/PID。权衡为更快的修剪如果前缀
如果不加修饰,则用~表示长寿。所有
其他修剪活动是最早的。特殊情况~ !
代表对噪音最大的自动快速修剪
由当前统计数据确定的UID。
- c彩色输出
- p ' <列表>…”,——修剪= ' <列表>……”
设置修剪白色和~黑色列表,使用相同的格式
上面列出的。必须引用。
—pid=<pid>仅从给定的pid打印日志。
——把睡眠时间包2小时,或者当缓冲器即将结束的时候
是第一位的。通过提供,提高轮询的效率
一个about-to-wrap唤醒。

过滤规格是一系列
<标记>(优先级):

其中<tag>是一个日志组件标签(或* for all),优先级为:
V详细(<标签>的默认值)
D调试(默认为'*')
我的信息
W警告
E错误
F致命
静音(抑制所有输出)

'*'本身表示'*:D', <tag>本身表示<tag>:V。
如果命令行上没有'*' filterspec或-s,所有过滤器默认为'*:V'。
例如:'*:S <tag>'只输出<tag>', ' tag>:S'压制所有<tag>日志消息。

如果没有在命令行中指定,filterspec将从ANDROID_LOG_TAGS中设置。

如果命令行上没有指定-v,则从ANDROID_PRINTF_LOG中设置format
或者默认为“threadtime”

猜你喜欢

转载自blog.csdn.net/liming066/article/details/82500391