【发布时间】:2016-10-01 08:53:12
【问题描述】:
当我在 Android 应用程序中简单地记录一条消息时,Android 监视器会打印太多多余的不需要的垃圾文本,例如: 代码:
Log.d(TAG, "From: " + "34369257099");
Log.d(TAG, "Message Notification Body: " + "Hello");
android 监视器中的输出:
10-01 14:15:33.262 18193-23771/com.xxxxx.xxxxxx D/MyFirebaseMsgService: From: 34369257099
10-01 14:15:33.262 18193-23771/com.xxxxx.xxxxxx D/MyFirebaseMsgService: Message Notification Body: Hello
[ 10-01 14:15:33.490 19060:19060 E/ ]
[adb] handle_packet() t->online(1) p->msg.arg0(9871) p->msg.arg1(0) OPEN
[ 10-01 14:15:33.490 19060:19060 E/ ]
[adb] handle the adb command, and the command = adb shell:cat /proc/net/xt_qtaguid/stats | grep 10206
[ 10-01 14:15:33.527 19060:19060 E/ ]
[adb] cuurent command is A_CLSE
[ 10-01 14:15:33.686 19060:19060 E/ ]
[adb] handle_packet() t->online(1) p->msg.arg0(9872) p->msg.arg1(0) OPEN
[ 10-01 14:15:33.686 19060:19060 E/ ]
[adb] handle the adb command, and the command = adb shell:cat /proc/18193/stat
[ 10-01 14:15:33.701 19060:19060 E/ ]
[adb] cuurent command is A_CLSE
[ 10-01 14:15:33.723 19060:19060 E/ ]
[adb] handle_packet() t->online(1) p->msg.arg0(9873) p->msg.arg1(0) OPEN
[ 10-01 14:15:33.723 19060:19060 E/ ]
[adb] handle the adb command, and the command = adb shell:cat /proc/stat
[ 10-01 14:15:33.740 19060:19060 E/ ]
[adb] cuurent command is A_CLSE
[ 10-01 14:15:34.051 19060:19060 E/ ]
[adb] handle_packet() t->online(1) p->msg.arg0(9874) p->msg.arg1(0) OPEN
[ 10-01 14:15:34.051 19060:19060 E/ ]
[adb] handle the adb command, and the command = adb shell:cat /proc/net/xt_qtaguid/stats | grep 10206
[ 10-01 14:15:34.086 19060:19060 E/ ]
[adb] cuurent command is A_CLSE
[ 10-01 14:15:34.258 19060:19060 E/ ]
[adb] handle_packet() t->online(1) p->msg.arg0(9875) p->msg.arg1(0) OPEN
[ 10-01 14:15:34.258 19060:19060 E/ ]
[adb] handle the adb command, and the command = adb shell:cat /proc/18193/stat
[ 10-01 14:15:34.274 19060:19060 E/ ]
[adb] cuurent command is A_CLSE
[ 10-01 14:15:34.294 19060:19060 E/ ]
[adb] handle_packet() t->online(1) p->msg.arg0(9876) p->msg.arg1(0) OPEN
[ 10-01 14:15:34.294 19060:19060 E/ ]
[adb] handle the adb command, and the command = adb shell:cat /proc/stat
[ 10-01 14:15:34.315 19060:19060 E/ ]
[adb] cuurent command is A_CLSE
[ 10-01 14:15:34.613 19060:19060 E/ ]
[adb] handle_packet() t->online(1) p->msg.arg0(9877) p->msg.arg1(0) OPEN
[ 10-01 14:15:34.613 19060:19060 E/ ]
[adb] handle the adb command, and the command = adb shell:cat /proc/net/xt_qtaguid/stats | grep 10206
[ 10-01 14:15:34.648 19060:19060 E/ ]
[adb] cuurent command is A_CLSE
[ 10-01 14:15:34.831 19060:19060 E/ ]
[adb] handle_packet() t->online(1) p->msg.arg0(9878) p->msg.arg1(0) OPEN
[ 10-01 14:15:34.831 19060:19060 E/ ]
[adb] handle the adb command, and the command = adb shell:cat /proc/18193/stat
[ 10-01 14:15:34.849 19060:19060 E/ ]
[adb] cuurent command is A_CLSE
[ 10-01 14:15:34.867 19060:19060 E/ ]
[adb] handle_packet() t->online(1) p->msg.arg0(9879) p->msg.arg1(0) OPEN
[ 10-01 14:15:34.867 19060:19060 E/ ]
[adb] handle the adb command, and the command = adb shell:cat /proc/stat
[ 10-01 14:15:34.885 19060:19060 E/ ]
[adb] cuurent command is A_CLSE
[ 10-01 14:15:35.176 19060:19060 E/ ]
[adb] handle_packet() t->online(1) p->msg.arg0(9880) p->msg.arg1(0) OPEN
[ 10-01 14:15:35.176 19060:19060 E/ ]
[adb] handle the adb command, and the command = adb shell:cat /proc/net/xt_qtaguid/stats | grep 10206
[ 10-01 14:15:35.210 19060:19060 E/ ]
[adb] cuurent command is A_CLSE
[ 10-01 14:15:35.404 19060:19060 E/ ]
[adb] handle_packet() t->online(1) p->msg.arg0(9881) p->msg.arg1(0) OPEN
[ 10-01 14:15:35.404 19060:19060 E/ ]
[adb] handle the adb command, and the command = adb shell:cat /proc/18193/stat
[ 10-01 14:15:35.421 19060:19060 E/ ]
[adb] cuurent command is A_CLSE
[ 10-01 14:15:35.439 19060:19060 E/ ]
[adb] handle_packet() t->online(1) p->msg.arg0(9882) p->msg.arg1(0) OPEN
[ 10-01 14:15:35.439 19060:19060 E/ ]
[adb] handle the adb command, and the command = adb shell:cat /proc/stat
[ 10-01 14:15:35.457 19060:19060 E/ ]
[adb] cuurent command is A_CLSE
[ 10-01 14:15:35.738 19060:19060 E/ ]
[adb] handle_packet() t->online(1) p->msg.arg0(9883) p->msg.arg1(0) OPEN
[ 10-01 14:15:35.738 19060:19060 E/ ]
[adb] handle the adb command, and the command = adb shell:cat /proc/net/xt_qtaguid/stats | grep 10206
[ 10-01 14:15:35.764 19060:19060 E/ ]
[adb] cuurent command is A_CLSE
[ 10-01 14:15:35.974 19060:19060 E/ ]
[adb] handle_packet() t->online(1) p->msg.arg0(9884) p->msg.arg1(0) OPEN
[ 10-01 14:15:35.974 19060:19060 E/ ]
[adb] handle the adb command, and the command = adb shell:cat /proc/18193/stat
[ 10-01 14:15:35.990 19060:19060 E/ ]
[adb] cuurent command is A_CLSE
[ 10-01 14:15:36.009 19060:19060 E/ ]
[adb] handle_packet() t->online(1) p->msg.arg0(9885) p->msg.arg1(0) OPEN
[ 10-01 14:15:36.009 19060:19060 E/ ]
[adb] handle the adb command, and the command = adb shell:cat /proc/stat
你能帮我解决这个问题吗?我的意思是为什么要打印这个额外的文本?我该如何摆脱这个? 我使用过滤器仅显示与包相关的日志,并尝试过滤 TAG 明智的。但是在附加的图片中看到仍然在一些日志中打印了垃圾文本。
提前致谢
【问题讨论】:
-
为什么不自己写日志文件呢?请参阅 Android 将日志写入文本文件:- stackoverflow.com/questions/1756296/…
-
这可以在“Hello World”项目中重现吗?如果你只执行
Log.d(TAG, "From: " + "34369257099");会发生什么? -
你会在不同的设备上重现这个吗?
-
@Hugosama 这无济于事......这个垃圾被添加到他自己的日志条目的输出中。这也发生在我身上,非常烦人