Logcat messages disappear after a short time - android

Sometimes eclipse logcat messages disappear after closing the app for a short time. (Mostly not so short.) How to make it never disappear automatically?
EDIT: My device is still attached. And how to set it to show log even after device disattach and clear just before next launch?

this is also happening with me. The device is attached. And so all the internal actions are getting logged and the error message disappears very quickly. You should try the following (it worked for me)
Restart Eclipse (as stated here Why logcat is not showing anything?)
if 1 does not work, you may try to increase the logcat message size. From Window > Preferences > Android > LogCat (increase size to more than 5000)
First one worked for me. In this way also you need not to detach the device everytime you deploy the app from eclipse. Regarding, the other question - you can always clear the existing log from [Clear log] button.

Related

Logcat is being "spammed", resulting in "Too much output to process"

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.

Android Studio Emulator E/AudioFlinger error message

When I start any device from the AVD Manager it just loops this error message infinitely:
E/AudioFlinger: read failed: framesRead=-1
It even does that when I create a new device. Doesn't matter if "Use Host GPU" is enabled or not.
When I start my application it would usually start up right after the emulated device started up. Since this error message appears it does not start my application automatically (the app can still be started manually though).
Anyone else had any experience with that and maybe a possible solution?
EDIT 1: It stops looping the error message as soon as i hit the app button. Seems to just occur on the home screen.
Open Google Settings app > Search & Now > Voice
Here you need to turn off "OK Google" Detection. It may be grayed out and disabled with mark "Retrieving settings...". To make it enabled, just change the language to any other one in the field above it. If selected language is unsupported for "OK Google" detection, the switch inside this menu will be also grayed, it fixes the problem as well.
I have the same problem, and if I don't stop it, Logcat will "say" "Too much output!" and if I still don't stop it, I get prompts to send an error report to Google, even freezes.
I finally learned to put a strange set of characters that can't possibly be displayed by an error message (I use "~~~~~") and put the same string as the first argument of my Log statements and all I see are my own messages. Of course this means I don't see errors, especially Exceptions, so I just put Excep after the string "~~~~~" and delete them one by one (otherwise, here comes the deluge again).
make sure you have audio permission in your manifest:
<uses-permission android:name="android.permission.RECORD_AUDIO" />

LogCat is not showing null pointer exception

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 ).

Application throws an error after relaunch

My application throws an error when I attempt to start it from "Recent applications". Problems :
Error appears only if application was inactive (stopped) for a long time (approximately one hour). I can't catch this error by myself - when I'm killing process by myself and then relaunched it there is no errors!
I can't see Exception log in debugger, since it's disconnects after so long time.
How can I catch such kind of errors in debugger? Looks error appears only when OS kills application by itself.
EDIT
I didn't overrided onResume method. Just onStart, and there is nothing special except instantination of my SQLiteOpenHelper.
even if your app is in paused/stopped state, log cat will still be working as long as device is connected. make sure you selected all logs options in windows > devices > all logs instead of windows > devices > com.your.project .
so when you will try to relaunch crash must be recorded in logCat
if still have any issue, install logcat app from market and refer it for logs.
Sounds like there might be an issue in your
OnResume
call. What is your application doing? Is it using a location manager? Does it have services or threads that need to be restarted? More infomation please.
Look through the Android application lifecycle chart:
http://developer.android.com/reference/android/app/Activity.html
It should help you understand what's going on. If all else fails, add a lot of logging to logcat and see what the output looks like on your end. As long as you don't unplug the device, you shouldn't lose that in Eclipse. If you do, you can always run "adb logcat" from the command line or shell to see exactly what's happening.

Logcat in eclipse keeps auto clearing

until recently my logcat has been fine but all of the sudden whenever i try to view it in eclipse it just keeps clearing itself whenever anything is displayed making it impossible to read. viewing it in the adb works but I never bother with that since it is just such a pain to read and find anything you are looking for.
is there a way to fix this problem?
The Logcat messages were simple getting cleared because the buffer had run out of space (receiving too many new messages), which is a simple setting change in Eclipse.
To fix, go to Window > Preferences > Android > LogCat
and increase the limit for "Maximum number of LogCat messages to buffer". Set it to 0 for unlimited size, or a really big number. But keep in mind, anything below 10000 fills up real fast.
Been answered already:
Eclipse Android - Logcat Clearing too Fast
It will show one line before erasing it to show the next one? Just click the verbose button again.
There's a workaround for this bug. Click active mode button (usually verbose), choose another device from device list and choose previous device again. It will restore all logcat messages.
LogCat is really annoying for this. In Ubuntu, I found the following works really well:
Open a terminal and type adb logcat | grep MYINFO
This will only show adb messages filtered by the MYINFO string.
So, you can code something like:
Log.v("MYINFO", "x" + x_value + ", etc...");
This is such a relief to use. A life saver! See this for more info.
You may find sometimes the logcat buffer repeats previous logs on starting again. To overcome this, type
adb logcat -c

Categories

Resources