当前位置:网站首页>logcat的使用
logcat的使用
2022-04-22 14:08:00 【猫咪老师nia~】
参考链接
log信息级别
以下优先级从上往下排序:
V:(verbose) 显示全部信息 (最低优先级),对应Log.v(String tag, String msg)D:(debug) 显示调试信息,对应Log.d(String tag, String msg)I:(information) 显示一般信息,对应Log.i(String tag, String msg)W:(warning) 警告,对应Log.w(String tag, String msg)E:(error) 错误看,对应Log.e(String tag, String msg)F:(Fatal)严重错误S:(Silent)无记载 (最高优先级,没有什么会被记载)
信息级别过滤
为了减少不想要日志的输出,可以建立一个过滤器,过滤语法:tag:priority
tag是标记(可以是具体的,*表示所有)priority是优先级,可以是组合
//仅输出标记为"ActivityManager"且优先级大于等于"Info"和标记为"PowerManagerService"并且优先级大于等于"Debug"的日志:
//*:S用于设置所有标记的日志优先级为S,这样可以确保仅输出符合条件的日志
adb logcat ActivityManager:I PowerManagerService:D *:S
adb logcat *:W //输出所有优先级大于等于"warning"的日志
adb logcat *:E //输出所有优先级大于等于"error"的日志
logcat *:W //显示所有优先级大于等于"warning"的日志
log选项列表
-b:(buffer)指定要查看的日志缓冲区,可以是system,events ,radio,main . 默认值是system和main-c:清除缓冲区中的全部日志并退出(清除完后可以使用-g查看缓冲区)-d:将缓冲区的log转存到屏幕中然后退出-f:(filename)将log输出到指定的文件中<文件名>.默认为标准输出(stdout)-g:打印日志缓冲区的大小并退出-n:(count)设置日志的最大数目count,默认值是4,需要和-r选项一起使用-r:(kbytes)没kbytes时输出日志,默认值是16,需要和-f选项一起使用-s:设置输出日志的标签, 只显示该标签的日志. 如果没设置标签等同于*:V-v:(format)设置日志输入格式
//组合使用:
adb logcat -v time -s appname:E > d:/1.log
cls
//显示BaseActivity 的日志信息
adb logcat -s BaseActivity
-b附加缓冲区
adb logcat -b radio:查看包含在无线/电话相关的缓冲区消息adb logcat -b events:查看事件相关的消息adb logcat -b main:查看主缓冲区 (默认缓冲区)adb logcat -b:什么也不加代表默认缓冲
-v控制日志格式
adb logcat -v brief:显示优先级/标记和原始进程的PID (默认格式)adb logcat -v process:仅显示进程PIDtag — 仅显示优先级/标记adb logcat -v thread: 仅显示进程:线程和优先级/标记adb logcat -v raw:显示原始的日志信息,没有其他的元数据字段adb logcat -v time: 显示日期,调用时间,优先级/标记,PIDadb logcat -v long: 显示所有的元数据字段并且用空行分隔消息内容
版权声明
本文为[猫咪老师nia~]所创,转载请带上原文链接,感谢
https://blog.csdn.net/Black_Cat_33/article/details/124305530
边栏推荐
- An error is reported when reading the attribute value of the object through the variable storage key value in TS (TS: 7053)
- 2022 examination questions and simulation examination of operation certificate for safety management personnel of hazardous chemical business units
- 处理高并发问题思路
- idea中pom.xml文件里mysql5.7坐标报红出错
- Special topic of game partners: breederdao reaches a new height in cooperation with fancy birds
- Independent station operation | 6 Facebook promotion tips, do you know?
- SQL optimized by us in those years
- CPT 104_Lab 09
- plsql developer文件编码格式设置
- 关于局域网特性的三个要素简述
猜你喜欢

Exercises and answers for the examination of main principals of hazardous chemical business units in 2022

2022年危险化学品经营单位主要负责人考试练习题及答案

2022危险化学品经营单位安全管理人员操作证考试题及模拟考试

985官宣:国际排名不再作为建设目标!

The more "intelligent" the machine is, the easier it is for data taggers to be eliminated? Manfu Technology

Osgearth configuring Map Resources

华为云媒体査勇:华为云在视频AI转码领域的技术实践

Redis connection tool cannot connect to redis in docker

【终于等到你】微信转发语音的方法 - 语音信息转发

【论文笔记】Vision Transformers for Dense Prediction
随机推荐
Why should the bank go to the fortress machine? Which one to choose? Are there any cases?
【机器人学习】移动机器人里程计学习记录
985官宣:国际排名不再作为建设目标!
樹莓派開發筆記(十二):入手研華ADVANTECH工控樹莓派UNO-220套件(一):介紹和運行系統
uniapp转微信小程序报错Cannot read property ‘forceUpdate‘ of undefined - 微信开发者工具报错
【鲲鹏迁移及实践帖子汇总】第一弹~~
Shiro之缓存管理
A solution to the problem of buying and selling stocks by force deduction
Redis相比memcached
Leetcode-819 the most common word
Special topic of game partners: breederdao reaches a new height in cooperation with fancy birds
Operation of 2022 chemical automation control instrument examination practice question simulation examination platform
985 official announcement: international ranking is no longer a construction goal!
Super user of oceanbase - system tenant sys
Genesis public chain gives Dao new vitality
Move blog to CSDN
BCC-stackcount
uniapp转微信开发者工具报错 - [ app.json 文件内容错误] app.json: 未找到 [“sitemapLocation“] 对应的 sitemap.json 文件
Recall, this year (Huashi 918 blood and tears paste)
2022年危险化学品经营单位主要负责人考试练习题及答案