Logcat不断显示消息

时间:2013-04-09 03:18:08

标签: android logcat flow

我不知道出了什么问题。我的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

3 个答案:

答案 0 :(得分:3)

此方法仅查看特定日志,而不是为了避免在logcat中出现不需要的日志。

  

adb shell logcat -s D / nicolas

  

adb shell logcat | grep D / nicolas

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

答案 1 :(得分:1)

我认为你错了,伙计。

Logcat会删除你手机中发生的一切,如果你选择"详细"或"调试"水平。 而且您似乎已经选择了"调试"。

您可以尝试转动"调试"警告"警告"或者"错误",那些对你来说无用的信息将会消失,不再为你烦恼。

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

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

答案 2 :(得分:1)

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

对我来说,通常会自动创建一个会话过滤器,因此我运行的任何程序都会被过滤掉。在“所有消息”下检查您的程序,然后单击它。这是我看起来的样子:

automatic session filter

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