當我只需登錄Android應用程序的消息,Android的監控打印太多額外的不必要的垃圾文字,如: 代碼:Log.d()或Log.e()在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將日誌寫入文本文件:https://stackoverflow.com/questions/1756296/android-writing-logs-to-text-file –
這可以在「Hello World」項目中重現嗎?如果你只是執行'Log.d(TAG,「From:」+「34369257099」);'? –
你是否在不同的設備上重現了這一點? – smora