Phone's Processes Flooding LogCat Output -- How To Eliminate those Messages?
Asked Answered
D

5

8

I know how to filter out messages in LogCat, so that's not what I am asking about.

The problem is that certain phones are "noisier" than others and flood the LogCat buffer to the point of triggering a bug that makes it discard newer messages.

This problem doesn't happen on the Nexus One, but it does happen with the Samsung Continuum i400, for example.

Is there a way to tell Android or LogCat to completely discard (i.e. not filter) messages from certain processes?

Donor answered 23/9, 2011 at 19:10 Comment(5)
You can at least click the "Clear Log" button once you start to overflow the LogCat buffer instead of restarting Eclipse. That's typically what I do when I run up against this behavior.Emblematize
@Emblematize Why are assuming that I don't do that? I do that frequently and before each new run, but it doesn't help. Some phones are so nasty that they bring Eclipse/LogCat to a point where it doesn't append new messages but rather clears all existing ones, replacing them with 5-10 messages and over and over again...Donor
I understand your issue, I run up against the exact same problem all the time. I'm just telling you what works for me. When the buffer overflows and starts to show you only 5-10 messages, I click "Clear Log". Then instead of 5-10 messages the LogCat behaves normally again (at least until the buffer fills up once more). All I'm saying is that I use that button instead of restarting Eclipse, which saves me a ton of time. Does clearing the Log in the middle of a run not work for you?Emblematize
@Emblematize Oh now I see. I clear the log as a preventive measure. I could swear that I tried your suggestion, too, but I can't 100% recall at the moment if I tried that after experiencing the problem I described. I am now debugging with the good phone. Once I get a chance to debug again with the nasty phone, I will report back. :) Thanks +1.Donor
@Emblematize I was just able to verify that your workaround works! Please post this as an answer so that you can get the bounty. :)Donor
E
2

"Clear Log" sometimes works. And sometimes it doesn't.

When "Clear Log" doesn't help, there is no need to restart Eclipse. All you have to do is show the Devices view in the DDMS perspective and the LogCat message will magically start appearing again.

You can then close the Devices view (if you don't need it).

Edmund answered 7/12, 2011 at 19:32 Comment(0)
W
4

There's no way to prevent any application of posting anything to logcat, as far as I know. All you can do is clear the log before capturing, and then filter out things you don't want to see. For example:

adb logcat -c 
adb logcat BadProcessName:S MyProcessName:V > log.txt
CTRL-C

I hope this helps.

What answered 28/9, 2011 at 14:5 Comment(1)
Thanks +1. @Emblematize was the first one to provide the workaround of clicking "Clear Log". If he doesn't post an answer, you will be the one getting the bounty. :)Donor
E
2

"Clear Log" sometimes works. And sometimes it doesn't.

When "Clear Log" doesn't help, there is no need to restart Eclipse. All you have to do is show the Devices view in the DDMS perspective and the LogCat message will magically start appearing again.

You can then close the Devices view (if you don't need it).

Edmund answered 7/12, 2011 at 19:32 Comment(0)
E
1

As @Emmanuel has mentioned, and as I mentioned in the comments, I don't believe there is a way to stop other applications from posting log messages. You can filter them, but you can't stop them completely.

The easiest solution that I have found when I run up against this problem is to simply hit the "Clear Log" button in Eclipse.

Clear Log Button in Eclipse

That should clear the buffer (at least until the noisy apps fill it up again). You can click the button at any time, so I find that it's most helpful to clear the log just before I perform the action that I want to debug.

I guess another option is to kill the process entirely. If the noisy application isn't critical to the app that you are trying to debug, you can just end the process.

Emblematize answered 4/10, 2011 at 0:31 Comment(0)
J
1

The best thing to do in this case would be to should use the filter functionality to only show the logs from your application. You can filter by PID or by application name.

Picture

Click the green plus button to create a filter for your app.

Jump answered 11/6, 2013 at 7:52 Comment(0)
L
0

You can restart the device to stop the processes from flooding the logcat This is the solution used by me every time

Lemke answered 3/8, 2013 at 6:39 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.