当出现类似如下错误日志时:

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

SRE实战 互联网时代守护先锋,助力企业售后服务体系运筹帷幄!一键直达领取阿里云限量特价优惠。

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 lines

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 WonderfulVideo

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 line

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

 

是因为相邻的几行打印内容完全相同,从Android O开始Log的chatty机制,会把中间的重复内容去掉不再打印。而是打印类似如上的 ”identical 5 lines“ ,告知开发者去除了几行

 

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

 

 

相关logcat 选项参考 https://www.jianshu.com/p/3fce87f12bb9   设置黑白名单(好像意思是通过设置白名单可以避免删减日志,未实验)

 

 

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

扫码关注我们
微信号:SRE实战
拒绝背锅 运筹帷幄