How can I stop the LogCat output from scrolling automatically in Eclipse?
Asked Answered
S

9

44

UPDATE: This turned out to be a bug in R14 of the SDK tools. It has been fixed in R15 which was released on Oct/27/2013. Updating to the latest release solves the problem as suggested in the accepted answer.

I use the LogCat window in the Debug view in Eclipse to diagnose and fix crashes in my code. I've noticed that the LogCat output will automatically scroll down anytime new lines are added (but only after you scroll to the bottom yourself).

This is great if I'm waiting for an exception stacktrace to come up, but extremely annoying if I'm trying to read something in the log and more lines are continuing to be added at the bottom (it keeps jumping to the bottom, so I scroll back to the error, then it jumps to the bottom again).

Is there any way to make it stay where I've placed it, when I place it, but continue to scroll automatically when I reach the bottom?

EDIT: Please note, I'm aware of filters and I don't consider this a solution to the problem.

ANOTHER EDIT: If I scroll up "far enough" from the bottom, it stops scrolling automatically. Far enough might be 5 lines or it might be 500 lines, it seems to be related to how many lines are in the log. Ideally, it would stop scrolling as long as I was at least 1 line away from the bottom.

Schoolman answered 19/10, 2011 at 23:35 Comment(7)
which version of ADT do you have installed? R14 is now available and may be better behavedDerain
This has always happened to me but seems to be more aggressive in the latest version.Schoolman
Alternatively use the ddms perspective to view logcat output fullscreen ( or near as) ... I've found this makes life a little easier.Derain
It's not nice to accept an answer that says the same I said a week earlier. At least I'm glad your problem was finally fixed.Sclaff
Sorry @Sergio, I hummed and hawed over which one to select but I chose Josephus' answer because the solution was more clearly stated.Schoolman
Possible duplicate of How to disable the autoscroll feature in Logcat?Intramural
@howettl, The second answer is much better.Crier
P
6

update to the latest version. the new logcat automatically filters your logs into the app-specific crash logs when you build-launch your app via eclipse.

Pol answered 27/10, 2011 at 7:29 Comment(6)
I am running R14. The app I'm working on is quite large and has a lot of output so it is still a problem when looking at app-specific logs.Schoolman
use a combination of Error filter and Tag filter. i can't see why you're still getting logs from other apps.Pol
I'm not getting logs from other apps. The app I'm working on has an enormous amount of log output.Schoolman
you can change the tag of the specific log you're trying to catch. you can even "search for matches" on the text of the logs you're looking for.Pol
one last shot at your problem - pipe your adb logcat into a text file (applying the necessary filters of course). adb logcat > logs.txtPol
I'm rewarding you the bounty because updating the SDK to the latest release (R15) is what solved the problem.Schoolman
W
43

In the LogCat tab on the upper far right there is a down pointing arrow with a line under it to enable

"Scroll Lock"

On older versions it's a pause button to

"Pause receiving new logcat messages"

That should do the trick!

Wendell answered 28/12, 2011 at 16:11 Comment(2)
note: "scroll lock" button activation turns ON automatic scrolling (slightly confusing for those of us who barely remember the scroll-lock key on the keyboard). I still see this behavior: scroll up the logcat, scroll-lock off. Message arrives in my "adb logcat" session but is filtered out by eclipse. Logcat display in eclipse jumps slightly (but doesn't go to bottom)Brogue
@Bojan, You need to disable the automatic state change because Eclipse tries to be smart about things a smart IDE should not try to be smart about.Crier
P
6

update to the latest version. the new logcat automatically filters your logs into the app-specific crash logs when you build-launch your app via eclipse.

Pol answered 27/10, 2011 at 7:29 Comment(6)
I am running R14. The app I'm working on is quite large and has a lot of output so it is still a problem when looking at app-specific logs.Schoolman
use a combination of Error filter and Tag filter. i can't see why you're still getting logs from other apps.Pol
I'm not getting logs from other apps. The app I'm working on has an enormous amount of log output.Schoolman
you can change the tag of the specific log you're trying to catch. you can even "search for matches" on the text of the logs you're looking for.Pol
one last shot at your problem - pipe your adb logcat into a text file (applying the necessary filters of course). adb logcat > logs.txtPol
I'm rewarding you the bounty because updating the SDK to the latest release (R15) is what solved the problem.Schoolman
A
6

I stopped having problems disable the option: Automatically enable / disable scroll lock based on the scrollbar position.

Window> Preferences> Android> Logcat> uncheck the option above.

In my case, I'm using Eclipse + Android Developer Tools (Build: v22.6.2-1085508)

I suggest that if I want to use eclipse, download the full package from this link: http://developer.android.com/sdk/index.html

After downloading, download all available updates, less NDK.

Articulate answered 27/5, 2014 at 22:28 Comment(0)
S
5

That's not what happens to me. If I scroll up it won't scroll down automatically when new lines come to the logcat until I scroll it to the bottom. Maybe it's because of the Eclipse or the Android SDK version. I'm using the latest right now.

Sclaff answered 19/10, 2011 at 23:47 Comment(2)
I am also using the latest. Maybe this is related to something else I've noticed: if I scroll up "far enough" from the bottom, it stops scrolling automatically. Far enough might be 5 lines or it might be 500 lines, it seems to depend how many lines are in the log.Schoolman
@howettl, You need to disable the automatic state change because Eclipse tries to be smart about things a smart IDE should not try to be smart about.Crier
G
2

You can do adb logcat in a shell, and use your terminal app's scroll buffer and scrolling features to manage the logcat output.

Goldfilled answered 25/10, 2011 at 18:11 Comment(3)
I would much rather use the Eclipse version. My productivity would drop drastically if I didn't have the cat icon :).Schoolman
It doesn't have to be an either-or thing. You can use logcat in a shell at the same time the Eclipse logcat view is running.Goldfilled
I see what you're saying, but it would be better if there was some sort of setting that I could change to control how the output scrolls in Eclipse rather than jumping back and forth between the two windows.Schoolman
Q
2
Window => Preferences => Android => Logcat

Uncheck the box called:

Display logcat view when there are messages from 
an application into the workspace
Queenie answered 23/2, 2012 at 8:11 Comment(2)
This prevents the logcat view from appearing on its own, but doesn't stop it from scrolling. Thanks though!Schoolman
@Olivier, Weird this option doesn't seem to exist.Crier
M
1

If you're only debugging crashes, click on the red (E) (error) filter for your main logcat, and keep your filter tab set to default to view all lines that are being reported by your application.

What ends up happening, when your application crashes it stays closed unless requested to restart by your choosing. So, the last lines in the logcat will be the crash report. This is one of the ways of how I debug crashes.

Mccloskey answered 25/10, 2011 at 20:9 Comment(1)
That's an interesting workaround but it doesn't help in the case where I'm not looking for errors.Schoolman
A
0

I also think it is "more aggressive" since the latest update! And it actually stops auto-scrolling when I scroll 10 or more lines up.

The best solution I have is clicking in the line you are interested in. If the logcat scrolls down too far and you don't see your line any more just press ArrowUp or ArrowDown to jump back to the line you were looking at.

Allman answered 27/10, 2011 at 11:40 Comment(3)
I'm glad to hear I'm not alone with this issue. I wasn't aware that up/down would bounce back to the selected line which is effective but not a solution to the problem. It does stop auto-scrolling if I move up a certain amount but sometimes that is quite far (much more than 10 lines).Schoolman
Actually I have R15 installed, just like the Josephus Villarey suggested. And auto-scrolling does only stop when I scroll at least 10 lines up O_oAllman
Yes, it takes about 10 lines for it to stop with R15. With R14 it was much more than 10 (at least for me... different users seem to report different results).Schoolman
J
0

If you write pid:pidofyourapp (which is written under online column in Device tab) in the search box,it will show the logs you wrote in your application.

Jenks answered 21/7, 2014 at 19:21 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.