2

我不知道怎么了。我的logcat困扰了我两天。当设备连接到测试时,虽然我没有运行我的应用程序,但 logcat 会不断给出消息。如果我运行我的应用程序,我无法在如此大量的数据中找到我的应用程序日志。有人可以建议我避免这种情况,以便我只能查看我的应用程序日志吗?下面是不断流动的logcat流程。我正在用 HTC 进行测试。

04-09 09:27:10.007: D/dalvikvm(843): GC_EXPLICIT freed 128K, 43% free 3530K/6151K, external 0K/0K, paused 142ms
04-09 09:27:10.027: I/LogFilter(843): Couldn't find the mandatory "Host" HTTP header.
04-09 09:27:10.027: I/LogService(843): 2013-04-09   09:27:10    127.0.0.1   -   127.0.0.1   8182    POST    /library/do/summary -   200 64  53  1304    http://null -   -
04-09 09:27:10.037: D/nicolas(843): HttpServerHelper commit
04-09 09:27:10.037: D/nicolas(843): sendResponse 1
04-09 09:27:10.057: D/nicolas(843): writeResponseBody
04-09 09:27:10.238: D/dalvikvm(843): GC_EXPLICIT freed 50K, 43% free 3522K/6151K, external 0K/0K, paused 158ms
04-09 09:27:10.408: D/dalvikvm(843): GC_EXPLICIT freed 4K, 43% free 3537K/6151K, external 0K/0K, paused 140ms
04-09 09:27:10.408: I/LogFilter(843): Couldn't find the mandatory "Host" HTTP header.
04-09 09:27:10.468: D/com.fd.httpd(843): sdcard phone type != 1
04-09 09:27:10.478: D/com.fd.httpd(843): emmc phone type != 1
04-09 09:27:10.498: I/com.fd.httpd(843): 1365479830502--enter query.
04-09 09:27:10.558: I/LogService(843): 2013-04-09   09:27:10    127.0.0.1   -   127.0.0.1   8182    GET /info/  -   200 1471    0   513 http://null -   -
04-09 09:27:10.568: D/nicolas(843): HttpServerHelper commit
04-09 09:27:10.568: I/Server(843): Addition of the standard header "pragma" is discouraged as a future versions of the Restlet API will directly support it.
04-09 09:27:10.578: W/Server(843): Addition of the standard header "cache-control" is not allowed. Please use the equivalent property in the Restlet API.
04-09 09:27:10.578: W/Server(843): Addition of the standard header "expires" is not allowed. Please use the equivalent property in the Restlet API.
04-09 09:27:10.578: D/nicolas(843): sendResponse 1
04-09 09:27:10.578: D/nicolas(843): writeResponseBody
04-09 09:27:10.598: I/com.fd.httpd(843): 1365479830607--leave query.
04-09 09:27:10.598: I/com.fd.httpd(843): sum size = 0
04-09 09:27:10.608: I/com.fd.httpd(843): Thread stateRUNNABLE
04-09 09:27:10.688: I/LogService(843): 2013-04-09   09:27:10    127.0.0.1   -   127.0.0.1   8182    POST    /library/do/summary -   200 64  53  252 http://null -   -
04-09 09:27:10.688: D/nicolas(843): HttpServerHelper commit
04-09 09:27:10.688: D/nicolas(843): sendResponse 1
04-09 09:27:10.698: D/nicolas(843): writeResponseBody
04-09 09:27:10.838: D/dalvikvm(843): GC_EXPLICIT freed 156K, 43% free 3525K/6151K, external 0K/0K, paused 124ms
04-09 09:27:10.848: I/LogFilter(843): Couldn't find the mandatory "Host" HTTP header.
04-09 09:27:10.898: I/com.fd.httpd(843): 1365479830906--enter query.
04-09 09:27:10.958: I/com.fd.httpd(843): 1365479830966--leave query.
04-09 09:27:10.958: I/com.fd.httpd(843): sum size = 0
04-09 09:27:10.958: I/com.fd.httpd(843): Thread stateRUNNABLE
04-09 09:27:11.048: I/LogService(843): 2013-04-09   09:27:11    127.0.0.1   -   127.0.0.1   8182    POST    /library/do/summary -   200 64  53  171 http://null -   -
04-09 09:27:11.048: D/nicolas(843): HttpServerHelper commit
04-09 09:27:11.048: D/nicolas(843): sendResponse 1
04-09 09:27:11.058: D/nicolas(843): writeResponseBody
04-09 09:27:11.199: D/dalvikvm(843): GC_EXPLICIT freed 93K, 43% free 3530K/6151K, external 0K/0K, paused 133ms
04-09 09:27:11.209: I/LogFilter(843): Couldn't find the mandatory "Host" HTTP header.
04-09 09:27:11.249: I/com.fd.httpd(843): 1365479831256--enter query.
04-09 09:27:11.319: I/com.fd.httpd(843): 1365479831324--leave query.
04-09 09:27:11.319: I/com.fd.httpd(843): sum size = 0
04-09 09:27:11.319: I/com.fd.httpd(843): Thread stateRUNNABLE
04-09 09:27:11.349: I/LogService(843): 2013-04-09   09:27:11    127.0.0.1   -   127.0.0.1   8182    POST    /library/do/summary -   200 64  53  119 http://null -   -
04-09 09:27:11.349: D/nicolas(843): HttpServerHelper commit
04-09 09:27:11.349: D/nicolas(843): sendResponse 1
04-09 09:27:11.359: D/nicolas(843): writeResponseBody
04-09 09:27:11.519: D/dalvikvm(843): GC_EXPLICIT freed 103K, 43% free 3522K/6151K, external 0K/0K, paused 147ms
04-09 09:27:11.539: I/LogFilter(843): Couldn't find the mandatory "Host" HTTP header.
04-09 09:27:11.569: I/com.fd.httpd(843): 1365479831577--enter query.
04-09 09:27:11.649: I/com.fd.httpd(843): 1365479831651--leave query.
04-09 09:27:11.649: I/com.fd.httpd(843): sum size = 0
04-09 09:27:11.649: I/com.fd.httpd(843): Thread stateRUNNABLE
04-09 09:27:11.799: D/dalvikvm(843): GC_EXPLICIT freed 71K, 43% free 3529K/6151K, external 0K/0K, paused 139ms
04-09 09:27:11.809: I/LogService(843): 2013-04-09   09:27:11    127.0.0.1   -   127.0.0.1   8182    POST    /library/do/summary -   200 64  53  261 http://null -   -
04-09 09:27:11.819: I/LogFilter(843): Couldn't find the mandatory "Host" HTTP header.
04-09 09:27:11.829: D/nicolas(843): HttpServerHelper commit
04-09 09:27:11.839: D/nicolas(843): sendResponse 1
04-09 09:27:11.849: D/nicolas(843): writeResponseBody
04-09 09:27:11.989: D/dalvikvm(843): GC_EXPLICIT freed 45K, 43% free 3526K/6151K, external 0K/0K, paused 123ms
04-09 09:27:12.119: D/dalvikvm(843): GC_EXPLICIT freed 1K, 43% free 3525K/6151K, external 0K/0K, paused 115ms
04-09 09:27:12.129: I/LogFilter(843): Couldn't find the mandatory "Host" HTTP header.
04-09 09:27:12.180: D/com.fd.httpd(843): sdcard phone type != 1
04-09 09:27:12.190: D/com.fd.httpd(843): emmc phone type != 1
04-09 09:27:12.210: I/com.fd.httpd(843): 1365479832225--enter query.
04-09 09:27:12.260: I/LogService(843): 2013-04-09   09:27:12    127.0.0.1   -   127.0.0.1   8182    GET /info/  -   200 1471    0   429 http://null -   -
04-09 09:27:12.260: D/nicolas(843): HttpServerHelper commit
04-09 09:27:12.270: I/Server(843): Addition of the standard header "pragma" is discouraged as a future versions of the Restlet API will directly support it.
04-09 09:27:12.270: W/Server(843): Addition of the standard header "cache-control" is not allowed. Please use the equivalent property in the Restlet API.
04-09 09:27:12.270: W/Server(843): Addition of the standard header "expires" is not allowed. Please use the equivalent property in the Restlet API.
04-09 09:27:12.270: D/nicolas(843): sendResponse 1
04-09 09:27:12.280: D/nicolas(843): writeResponseBody
04-09 09:27:12.430: I/com.fd.httpd(843): 1365479832442--leave query.
04-09 09:27:12.430: I/com.fd.httpd(843): sum size = 0
04-09 09:27:12.430: I/com.fd.httpd(843): Thread stateRUNNABLE
04-09 09:27:12.560: I/LogService(843): 2013-04-09   09:27:12    127.0.0.1   -   127.0.0.1   8182    POST    /library/do/summary -   200 64  53  403 http://null -   -
04-09 09:27:12.570: D/nicolas(843): HttpServerHelper commit
04-09 09:27:12.570: D/nicolas(843): sendResponse 1
04-09 09:27:12.580: D/nicolas(843): writeResponseBody
04-09 09:27:12.750: D/dalvikvm(843): GC_EXPLICIT freed 152K, 43% free 3535K/6151K, external 0K/0K, paused 159ms
04-09 09:27:12.770: I/LogFilter(843): Couldn't find the mandatory "Host" HTTP header.
04-09 09:27:12.810: I/com.fd.httpd(843): 1365479832825--enter query.
04-09 09:27:12.940: I/com.fd.httpd(843): 1365479832950--leave query.
04-09 09:27:12.940: I/com.fd.httpd(843): sum size = 0
04-09 09:27:12.940: I/com.fd.httpd(843): Thread stateRUNNABLE
04-09 09:27:13.070: I/LogService(843): 2013-04-09   09:27:13    127.0.0.1   -   127.0.0.1   8182    POST    /library/do/summary -   200 64  53  289 http://null -   -
04-09 09:27:13.080: D/nicolas(843): HttpServerHelper commit
04-09 09:27:13.080: D/nicolas(843): sendResponse 1
04-09 09:27:13.090: D/nicolas(843): writeResponseBody
04-09 09:27:13.261: D/dalvikvm(843): GC_EXPLICIT freed 97K, 43% free 3533K/6151K, external 0K/0K, paused 163ms
04-09 09:27:13.271: I/LogFilter(843): Couldn't find the mandatory "Host" HTTP header.
04-09 09:27:13.441: D/dalvikvm(843): GC_EXPLICIT freed 34K, 43% free 3525K/6151K, external 0K/0K, paused 127ms
04-09 09:27:13.461: I/LogFilter(843): Couldn't find the mandatory "Host" HTTP header.
04-09 09:27:13.481: I/com.fd.httpd(843): 1365479833498--enter query.
04-09 09:27:13.631: D/dalvikvm(843): GC_EXPLICIT freed 63K, 43% free 3536K/6151K, external 0K/0K, paused 125ms
04-09 09:27:13.681: D/com.fd.httpd(843): sdcard phone type != 1
04-09 09:27:13.691: D/com.fd.httpd(843): emmc phone type != 1
04-09 09:27:13.731: I/com.fd.httpd(843): 1365479833746--leave query.
04-09 09:27:13.731: I/com.fd.httpd(843): sum size = 0
04-09 09:27:13.731: I/com.fd.httpd(843): Thread stateRUNNABLE
04-09 09:27:13.751: I/LogService(843): 2013-04-09   09:27:13    127.0.0.1   -   127.0.0.1   8182    POST    /library/do/summary -   200 64  53  461 http://null -   -
04-09 09:27:13.771: D/nicolas(843): HttpServerHelper commit
04-09 09:27:13.771: D/nicolas(843): sendResponse 1
04-09 09:27:13.791: D/nicolas(843): writeResponseBody
04-09 09:27:13.791: I/LogService(843): 2013-04-09   09:27:13    127.0.0.1   -   127.0.0.1   8182    GET /info/  -   200 1471    0   293 http://null -   -
04-09 09:27:13.791: D/nicolas(843): HttpServerHelper commit
04-09 09:27:13.801: I/Server(843): Addition of the standard header "pragma" is discouraged as a future versions of the Restlet API will directly support it.
04-09 09:27:13.801: W/Server(843): Addition of the standard header "cache-control" is not allowed. Please use the equivalent property in the Restlet API.
04-09 09:27:13.941: D/dalvikvm(843): GC_EXPLICIT freed 70K, 43% free 3541K/6151K, external 0K/0K, paused 134ms
04-09 09:27:13.941: W/Server(843): Addition of the standard header "expires" is not allowed. Please use the equivalent property in the Restlet API.
04-09 09:27:13.941: D/nicolas(843): sendResponse 1
04-09 09:27:13.961: I/LogFilter(843): Couldn't find the mandatory "Host" HTTP header.
04-09 09:27:13.961: D/nicolas(843): writeResponseBody
04-09 09:27:14.011: I/com.fd.httpd(843): 1365479834023--enter query.
04-09 09:27:14.081: I/com.fd.httpd(843): 1365479834094--leave query.
04-09 09:27:14.081: I/com.fd.httpd(843): sum size = 0
04-09 09:27:14.081: I/com.fd.httpd(843): Thread stateRUNNABLE
04-09 09:27:14.101: I/com.fd.httpd(843): 1365479834113--leave applyBatch.
04-09 09:27:14.111: I/LogService(843): 2013-04-09   09:27:14    127.0.0.1   -   127.0.0.1   8182    POST    /library/do/summary -   200 64  53  125 http://null -   -
04-09 09:27:14.121: D/nicolas(843): HttpServerHelper commit
04-09 09:27:14.121: D/nicolas(843): sendResponse 1
04-09 09:27:14.131: D/nicolas(843): writeResponseBody
04-09 09:27:14.262: D/dalvikvm(843): GC_EXPLICIT freed 140K, 43% free 3512K/6151K, external 0K/0K, paused 119ms
04-09 09:27:14.272: I/LogFilter(843): Couldn't find the mandatory "Host" HTTP header.
04-09 09:27:14.332: I/com.fd.httpd(843): 1365479834330--enter query.
04-09 09:27:14.392: I/com.fd.httpd(843): 1365479834406--leave query.
04-09 09:27:14.392: I/com.fd.httpd(843): sum size = 0
04-09 09:27:14.392: I/com.fd.httpd(843): Thread stateRUNNABLE
04-09 09:27:14.422: I/LogService(843): 2013-04-09   09:27:14    127.0.0.1   -   127.0.0.1   8182    POST    /library/do/summary -   200 64  53  115 http://null -   -
04-09 09:27:14.422: D/nicolas(843): HttpServerHelper commit
04-09 09:27:14.422: D/nicolas(843): sendResponse 1
04-09 09:27:14.432: D/nicolas(843): writeResponseBody
04-09 09:27:14.562: D/dalvikvm(843): GC_EXPLICIT freed 95K, 43% free 3517K/6151K, external 0K/0K, paused 119ms
04-09 09:27:14.572: I/LogFilter(843): Couldn't find the mandatory "Host" HTTP header.
04-09 09:27:14.632: I/com.fd.httpd(843): 1365479834644--enter query.
04-09 09:27:14.682: I/com.fd.httpd(843): 1365479834693--enter applyBatch.
04-09 09:27:14.712: I/com.fd.httpd(843): 1365479834728--leave query.
04-09 09:27:14.722: I/com.fd.httpd(843): sum size = 0
04-09 09:27:14.722: I/com.fd.httpd(843): Thread stateRUNNABLE
04-09 09:27:14.732: I/LogService(843): 2013-04-09   09:27:14    127.0.0.1   -   127.0.0.1   8182    POST    /library/do/summary -   200 64  53  149 http://null -   -
04-09 09:27:14.742: D/nicolas(843): HttpServerHelper commit
04-09 09:27:14.752: D/nicolas(843): sendResponse 1
04-09 09:27:14.762: D/nicolas(843): writeResponseBody
04-09 09:27:14.912: D/dalvikvm(843): GC_EXPLICIT freed 103K, 43% free 3517K/6151K, external 0K/0K, paused 144ms
04-09 09:27:14.932: I/LogFilter(843): Couldn't find the mandatory "Host" HTTP header.
04-09 09:27:14.962: I/com.fd.httpd(843): 1365479834978--enter query.
04-09 09:27:15.112: D/dalvikvm(843): GC_EXPLICIT freed 68K, 43% free 3523K/6151K, external 0K/0K, paused 136ms
4

3 回答 3

3

这种方法是只查看特定的日志,而不是避免不需要的日志进入 logcat。

adb shell logcat -s D/nicolas

或者

adb shell logcat | grep D/尼古拉斯

例如,您只想查看标记为“nicolas”的日志

于 2013-04-09T03:22:18.400 回答
1

在 Eclipse 中,当查看 DDMS 中的 logcat 选项卡时,实际 logcat 输出的左侧应该有一个“Saved Filters”窗口。过滤器可能是您希望只查看您的消息(您输出的消息,以及您的应用程序生成的一些系统消息)的方式,因此您只需要获得一个有效的。

对我来说,会话​​过滤器通常是自动创建的,所以我正在运行的任何程序都会被过滤掉。在“所有消息”下检查您的程序并单击它。这是我的样子:

自动会话过滤器

如果会话过滤器不是自动创建的,那么只需创建一个。单击绿色加号,然后将您的应用程序名称放入“按应用程序名称”文本框中。

于 2013-04-09T04:04:26.800 回答
1

我想你搞错了,伙计。

如果您选择“详细”或“调试”级别,Logcat 会记录您的 android 手机中发生的一切。而且您似乎选择了“调试”。

您可以尝试将“debug”调低为“warn”或“error”,那些对您来说似乎无用的消息将消失,不再打扰您。

但是,我不支持您这样做,因为它会让您全面了解您的手机状态,并且您会发现它在您以后的开发中非常有用!

希望我的回答能帮助您解决问题!^_^

于 2013-04-09T03:56:45.677 回答