Whenever I connect my Samsung Galaxy S5 (running Android 4.4.2) to my computer, the Logcat in Android Studio starts being "spammed" by the same message multiple times ~1600 times per second, resulting in the message "Too much output to process" appearing in a yellow box in Logcat. This is when there is no filtering and no debug process selected.
The Logcat message is this:
D/tms_audio_hw/AudioTmsIpc AudioTmsClientListen accept Done gAudioClientAcceptSockFd -1 gAudioClientLocalSockFd 24
Googling it reveals surprisingly little. Actually nothing. I'm not sure, but it seems to be affecting the logging from my application as well, because when I select my application as the debug process, I don't get all the Logcat outputs from my application - sometimes I'll get some, sometimes I'll get others, sometimes I'll get none.
Also, because of this my computer starts using CPU like crazy just to process those messages, resulting in extreme CPU usage and fans at full blast!
What the heck is causing this?
EDIT
I have now looked at exactly how fast these logs are coming in, and it's at a rate of 1600 logs per second, and it's just this same message over and over and over. Don't tell me this is "normal behaviour" unless you are experiencing this on your own devices.
You may have selected "No Filters" in android monitor which causes "Too much output to process error", Change it to "Show only selected Application" then all other Log line are filtered and will not show in Logcat.
Here is snapshot of Android Monitor.
I had a similar problem while testing an app. Initially the log messages displayed as expected and then it started to display my log messages "at random", i.e. showing and then not showing.
Removing the Logcat filter showed the "too much output to process" message. I also noticed that the log was displaying messages relating to apps installed on my phone (I was using a phone to test my app) and had nothing to do with my app.
I disconnected the phone from my laptop, restarted the phone and then re-connected it back to the laptop and ran the app. The Logcat was back to normal, showing the log messages as expected.
That is normal behaviour; it is not related to a particular phone model or Android OS version. When you remove all filters, there's just too much logging output being redirected from everything that can and does log, including system components and various libraries that are loaded at that time.
The recommended default approach is to simply filter out and view only your application's log output and switch to no filtering only when you are specifically debugging something where you need to know what else is happening around that part of code.
Related
Sometimes when a phone connects to Android Studio, it will print logs between the time it was last connected to Android Studio and the present. This is cool, but I can not replicate it. Some times it happens, sometimes it does not.
I have a guess that this is a feature of USB and wireless debugging, and that logs are put in a temporary file so they can be sent to logcat when reconnected. If so, how do I keep the USB debugging from turning off when testing my device in the field during the day, so I can get the logs that were printed during the day? If not, what is happening?
The logs are nothing to do with Android Studio (or logcat in general) - it's just system logging happening on the device, and that happens whether it's connected to a log-reader or not.
At a guess, what's happening is your app's process is being closed, so the next time it runs it gets a different PID (process ID). When you connect it to the computer, your dropdown shows the currently running app process, and filters by its PID, so you don't see the old stuff.
You've probably seen this while debugging - if you re-run your app, the log "clears" and gives you a fresh one for the new run of the app. The old log messages are still there (as well as a hell of a lot of other logs for all the stuff going on on the device - it is noisy), it's just that you can't see them.
The simple thing to try is going to the filter dropdown on the right of the logcat window, and choose No filtering. Then in the filter query thing next to it (with the 🔎) type the name of your app, maybe its package. It's not perfect but it should show you all of the logs it has from your app, along with a bunch of system stuff that's also referring to it. You could get clever with PIDs or setting up a custom filter in the dropdown to get better results.
You might also be interested in the guide (with some filtering tips) and the commandline version if that's more useful to you
What's the difference between Logcat and Run in Android-Studio?
Logcat has filter-options. Beside that I don't get which specific purpose each serve.
In how far do the messages differ, which become printed to each console?
When do I use which console?
Personally,Logcat is more useful for debugging and being aware of what is going on while the app is running. You set the type of the log and set tags to them, by this way you can easily filter logs. This gives you much more clear picture in terms of logging.it stated in this article
Logcat is a command-line tool that dumps a log of system messages, including stack traces when the device throws an error and messages that you have written from your app with the Log class.
Also, it is stated that (in the same article)
The priority is one of the following character values, ordered from lowest to highest priority:
V: Verbose (lowest priority)
D: Debug
I: Info
W: Warning
E: Error
F: Fatal
S: Silent (highest priority, on which nothing is ever printed)
each one of these shows the logs from their priority to highest one . Verbose, for instance, will print all the logs but if you switch to error , logcat only shows error and fatal logs.
Additionally, if you set a tag filter it will only shows the logs that is tagged with that "tag", of course while keeping the priority filter. For instance
Log.e("tag1","message_1");
Log.e("tag2","message_2");
Assume you have filter the tags with "tag1". The logcat will print "message_1".
Similarly
Log.e("tag1","message_1");
Log.i("tag1","message_2");
Again, assume that you have filter tags by "tag1" and priorities with Error.Then, the logcat will show only "message_1".
For the run tool also shows logs , prints (println etc.) but in comparison with the logcat it will show a lot more stuff (logs, prints (println etc. and phone related informations).
apart from your logs other logs that comes from libraries and phone itself also are shown in the run tool. So it hard to find your own logs.
Run will be useful when the phone and library related information logs needed.(for instance when the phone misses/drop frames it will be printed in run)
Logcat will be useful for your own logs.When you are trying to understand what is going on while the app runs etc..
I have noticed a big difference between the run and the logcat while using avd emulators. I had a deceiving crash on my app, only while I was using the emulators .
every time there was a crash , the logs before the crash were disappearing from the logcat , and I couldn't understand if I see the logs related to the crash. after a week of trying to find a library that prints the logs to a file I found out that everything is printed in the run tab, so I don't need that.
My LogCat is often not showing null pointer exceptions..
Sample:
ProgressDialog pd;
ps.show();
Application stops (do not reacts for any action), but there is no information about any reason in logcat.
Another sample is with database - if there is no DB and I'm making actions on it, the same happens.
I tried (that action with DB) on my colleague's phone and there was normal error. I have all needed programmer options in my phone turned on.
Maybe someone know , why it is so? It was not burdensome, when I had small app, but now when it's bigger, it can be really frustrating.
I get this with android studio too...
Close android studio, restart ADB, and generally it starts working for me.
If that does not work then put a breakpoint at the line .show(); ... Then open up the logcat and then skip over the breakpoint. It then shows, I have similar issues.
(Windows 7 64 bit - Android Studio 0.82)
I dont like the IDE logcat option honestly.
The SDK comes with an adb binary, use the logcat option from there via
adb logcat or my personal favorite built in alias, adb lolcat
This will give you the log information for EVERYTHING happening on the device, and can be useful tracking down issues caused by device state.
For example, you can see network changes in the logcat, and if your app crashes on network call you wouldnt have any idea why if you just used the logcat output from your app.
In my case I was using: Thread.setDefaultUncaughtExceptionHandler in my application file. If that is not turned off during debugging you won't see any exception output. ( Just make sure to turn it back on again when you release so you can still handle your issues ).
When testing on a device in Android Studio you get an awful lot of output in the logcat.
I'm only interested in the output for the app I'm developing. I can see just this, after running, by opening the Devices section and manually selecting my apps process. Problem is, it's pretty tedious to do this every time I run my app, which seems to be the case.
Is there a way to get it to remember this setup?
How about a way to get it to stop reporting anything after I'm done with my app or it's crashed ? (otherwise my app specific stuff gets buried so quickly by output from other proccesses on my phone)
I'm open to other ways of filtering the logcat too, however I couldn't think of a way to set up filters so that I would get my tagged Log messages AND other exceptions I wasn't expecting.
Any suggestions?
Normally this is done by default, but if not,
in logcat, the green plus sign, when you click it you get a dialog, fill the byApplicationName with your package name, and also your filter name with something, now you can filter your output according to your app
with that beeing said, sometimes you don't get the filter column info (application name) in logcat at all (blank), here (and I my self don't know the cause of it) just forget it for a while and retry again
Sometimes I am on the lookout for specific logcat messages for debugging purposes and its critical to see exactly when they appear. I then make a logcat filter (call it xx) in eclipse ready to spot the critical message. I then highlight the xx filter and run my app and look out for my message - nothing appears in my xx filer view - but I notice increasing numbers win brackets next to the "All messages (no filters)". If I then click on the All messages thing and then go back to xx then hey-presto my messages are visible. Its almost as if eclipse is determined never to let me see these messages as they arrive. Is there anything I can do about this?
I've found that part of the eclipse plugin very unreliable, especially if there are a high volume of log messages it is prone to making the whole window slow / freeze.
Personally, I tend to run logcat in a shell, sometimes piped into grep
tee can also be useful, to write a copy to disk for later examination.
Make sure that logcat isn't paused.