Android logcat lines missing缘由分析

当出现相似以下错误日志时:css

2019-04-14 17:51:14.506 10189-10189/com.ss.android.ex.parent D/GGK: no WonderfulVideoandroid

2019-04-14 17:51:14.506 10189-10189/com.ss.android.ex.parent I/chatty: uid=10774(u0_a774) com.ss.android.ex.parent identical 5 lineside

2019-04-14 17:51:14.506 10189-10189/chatty D/GGK: no WonderfulVideo源码分析

2019-04-14 17:51:14.506 10189-10189/com.ss.android.ex.parent D/GGK: has WonderfulVideoui

2019-04-14 17:51:14.506 10189-10189/com.ss.android.ex.parent I/chatty: uid=10774(u0_a774) com.ss.android.ex.parent identical 1 linespa

2019-04-14 17:51:14.506 10189-10189/com.ss.android.ex.parent D/GGK: has WonderfulVideo.net

 

是由于相邻的几行打印内容彻底相同,从Android O开始Log的chatty机制,会把中间的重复内容去掉再也不打印。而是打印相似如上的 ”identical 5 lines“ ,告知开发者去除了几行日志

 

这个删除操做是在Android源码的 /system/core/logd/LogBufferElement.cpp 文件中实现的,相似的还有一个  expire x lines  日志code

 

 

相关logcat 选项参考 https://www.jianshu.com/p/3fce87f12bb9   blog

https://blog.csdn.net/kennethyo/article/details/76603228  设置黑白名单(好像意思是经过设置白名单能够避免删减日志,未实验)==>设置黑白名单好像是无效的,简单试了一次。

修改prop中的值应该可行(未实验,手机需Root)

setprop ro.logd.filter disable setprop persist.logd.filter disable

 

 

日志处理侧源码分析:https://blog.csdn.net/kc58236582/article/details/51506896

相关文章
相关标签/搜索