作者:万境绝尘转载请著名出处
eclipse 自带的 LogCat 工具太垃圾了,开始用 adb logcat 在终端查看日志;
1. 解析 adb logcat 的帮助信息
在命令行中输入adb logcat --help命令,就可以显示该命令的帮助信息;
- octopus@octopus:~$adblogcat--help
- Usage:logcat[options][filterspecs]
- optionsinclude:
- -sSetdefaultfiltertosilent.
- Likespecifyingfilterspec'*:s'
- -f<filename>Logtofile.Defaulttostdout
- -r[<kbytes>]Rotatelogeverykbytes.(16ifunspecified).Requires-f
- -n<count>Setsmaxnumberofrotatedlogsto<count>,default4
- -v<format>Setsthelogprintformat,where<format>isoneof:
- briefprocesstagthreadrawtimethreadtimelong
- -cclear(flush)theentirelogandexit
- -ddumpthelogandthenexit(don'tblock)
- -t<count>printonlythemostrecent<count>lines(implies-d)
- -ggetthesizeofthelog'sringbufferandexit
- -b<buffer>Requestalternateringbuffer,'main','system','radio'
- or'events'.Multiple-bparametersareallowedandthe
- resultsareinterleaved.Thedefaultis-bmain-bsystem.
- -Boutputtheloginbinary
- filterspecsareaseriesof
- <tag>[:priority]
- where<tag>isalogcomponenttag(or*forall)andpriorityis:
- VVerbose
- DDebug
- IInfo
- WWarn
- EError
- FFatal
- SSilent(supressalloutput)
- '*'means'*:d'and<tag>byitselfmeans<tag>:v
- Ifnotspecifiedonthecommandline,filterspecissetfromANDROID_LOG_TAGS.
- Ifnofilterspecisfound,filterdefaultsto'*:I'
- Ifnotspecifiedwith-v,formatissetfromANDROID_PRINTF_LOG
- ordefaultsto"brief"