在Moto G上开发应用程序时,我经常遇到成千上万条以下消息充斥着日志。
E/MM_OSAL ( 275): isSamePayload Sync byte(0x47) not found!! m_nCurrOffset=0
E/MM_OSAL ( 275): isSamePayload Sync byte(0x47) not found!! m_nCurrOffset=0
... repeated 20000 times in a span of 12 secs
D/WifiStateMachine(1004): processMsg: L2ConnectedState
D/WifiStateMachine(1004): handleMessage: X
D/WifiStateMachine(1004): handleMessage: E msg.what=131155
... repeated 15000+ times all interspersed together
现在,我当然已经设置了Logcat过滤器,但是所有这些消息都填满了Logcat缓冲区,而我自己的调试消息却不断消失。
观察结果
如何阻止这些不必要的消息溢出Logcat缓冲区?
更新:好吧,我想我已经找到了一些线索。 Logcat缓冲区未清除
$ ./adb logcat -g
/dev/log/main: ring buffer is 256Kb (255Kb consumed), max entry is 5120b, max payload is 4076b
/dev/log/system: ring buffer is 256Kb (0Kb consumed), max entry is 5120b, max payload is 4076b
$ ./adb logcat -c
$ ./adb logcat -g
/dev/log/main: ring buffer is 256Kb (255Kb consumed), max entry is 5120b, max payload is 4076b
/dev/log/system: ring buffer is 256Kb (0Kb consumed), max entry is 5120b, max payload is 4076b
如您所见,
main
缓冲区没有被清除-也许这就是我的应用程序的消息未将其传递到logcat的原因。 最佳答案
您可以执行以下操作来解决此问题:
1)转到Eclipse-> DDMS->设备,然后单击您的设备列表。
或
2)假设您已安装和adb ,请转到命令提示符并键入
adb logcat > logs.txt
这会将logcat消息转储到logs.txt文件中,然后您可以将其打开并在日志中解析调试消息以获取所需的内容。