Android Logcat记录Chatty模块行过期消息 [英] android logcat logs chatty module line expire message
问题描述
我收到许多与我的应用程序有关的此类logcat消息.
I am getting lots of this kind of logcat messages related to my application.
11-19 19:04:23.872 3327 3440 I chatty : uid=10085 com.xxxx.yyy expire 18 lines
这些日志消息是什么?我在这里缺少我的实际应用程序logcat日志吗?
What are these log messages? Am I missing my actual application logcat logs here?
推荐答案
我想添加另一个答案,因为现有答案中没有一个实际上回答了'我在这里缺少实际的应用程序logcat日志吗?问题.
I want to add another answer because none of the existing answers actually answered the 'Am I missing my actual application logcat logs here?' question.
是的,您丢失了日志. .一旦应用程序被logcat认为是聊天"(每秒超过5行),应用程序的日志就会崩溃.
Yes, you're missing the logs. As soon as app considered 'chatty' by logcat (more than 5 lines per second), logs of your app will be collapsed.
您可以通过将您的应用列入logcat的白名单来避免此行为:
You can avoid this behaviour by whitelisting your app for logcat:
adb logcat -P '<pid or uid of your app>'
您可以执行以下命令来打印当前的黑白列表:
You can print the current white and black lists by executing:
adb logcat -p
此命令还有助于打印logcat统计信息:
Also this command is helpful to print logcat statistics:
adb logcat -S
另外,我发现在测试过程中直接从代码中将我的应用程序自动添加到logcat白名单中很有用:
Additionally, I found useful to auto-whitelist my app for logcat directly from code during tests:
int pid = android.os.Process.myPid();
String whiteList = "logcat -P '" + pid + "'";
Runtime.getRuntime().exec(whiteList).waitFor();
更多信息可在logcat的官方文档中找到此处
More info can be found in official docs for logcat here
这篇关于Android Logcat记录Chatty模块行过期消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!