How to disable the autoscroll feature in Logcat?
Asked Answered
C

5

29

I use LogCat to look at the debug output of my apps. If other apps are running or the system has of the test device has some noisy background threads running LogCat will scroll all the time and I have to correct my position manually to read long stack traces.

Is there a way to disable the scrolling in LogCat? Or somehow tweak the scrolling settings?

Comeon answered 22/7, 2011 at 10:8 Comment(0)
C
12

One way is to create a filter for all the noisy services.

Just create a filter with the tag of the disturbing logs. Logcat will not filter those messages out of the main logview and slow down the scrolling.

This is not the best solution. It will lead to a LogCat with 15 or 20 different filters only used to remove not used log output.

UPDATE Additionally to using filters one of the last updates of the android tools added a pause button to logcat. Just click the button and autoscroll is disabled.

Comeon answered 22/7, 2011 at 10:10 Comment(6)
Actually i recommend filters. But the other way around. When I work with the logcat, i use a few filters: One for my app, one filter that grabs AndroidRuntime (Exceptions get dumped in there) and one for system.err and system.out. Usually you need even only the first two. System.err and out are rarely used (e.g. JSONObject throws exceptions to there). Let the main log fill with trash.Binkley
I swear the log used to stop when you clicked a certain line. I should have thought of making a filter because I really just wanted the crashes which I now filter via 'ACRA' since I use that, works a charm!Landman
The "Scroll Lock" button in Logcat looks more like a Download button, that's why I overlooked it... Thanks for pointing out it exists!Ahwaz
The "Scroll Lock" button does not always work... it seems to be very buggy unfortunately.Oversew
@Janusz, You mean the "scroll lock" button right. Not "pause".Delaney
@Stan, 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.Delaney
P
11

In Logcat at top right there is a button that looks like an arrow pointing downward with line under it. Toggle it to switch autoscrolling on and off.

logcat buttons

Permanency answered 11/4, 2013 at 6:28 Comment(5)
Everytime I click the slider arrows to scroll up and down it enables that button again and autoscrolls back down to the bottom. Clicking on a row and using arrow keys to scroll up worked for me.Amendment
@JustinDanielson: There is a setting in the Android section of the preferences to auto-enable auto-scroll in some circumstances. You can disable that if you would like.Turgent
Wow, this was a long time ago. When I was doing Android dev, I played with this setting but a bug either in Eclipse or LogCat would cause auto scroll to be toggled on and off. Endless frustration.Amendment
Thank you so much dear.. I hate eclipse..sometimes.Clarkson
Thanks Jon. On linux/gnome systems there seems to be a bug that triggers the auto-enable scroll lock too often. Changing the preference is a workaround.Teahan
F
9

The question may be a couple of years old, but since it pops up first in Google, I'll just drop this here.

In Eclipse, go to Window, Preferences. Under Android, there is a category LogCat. In this category, there is an option Automatically enable/disable scroll lock based on the scrollbar position. Untick this to disable the automatic scrolling.

Filler answered 27/10, 2014 at 10:56 Comment(3)
I got so frustrated with Eclipses autoscroll and filtering that I made LogRabbit. Maybe it can help you too? lograbbit.comVogele
@Yepher, that looks awesome! Unfortunately, I'm not working on Mac. Any plans for a Windows-based version?Filler
Yes, if it turns out helpful for Mac folks I do plan to port it to Windows.Vogele
S
5

I found a quick fix. In the Logcat, slide the scroller to the top. When autoscroll is need slide to the bottom. You can also use arrow keys.

Siegler answered 14/1, 2012 at 13:12 Comment(0)
S
0

I agree with uh… your own answer. You don't give any details on the environment so I'm maybe off-topic but here my experience under GNU/Linux (without using Eclipse at all):

First, I always define an application-wide tag as a project constant and use that tag for filtering with a scripts/log simple bash script (checked in Version Control Systems) as follow

#!/bin/bash
adb logcat LoaderManager:V MyApplicationTag:V MyExternalButInvolvedProvider:V SomeDepLibProjectTag:V *:E | ./scripts/coloredlogcat

Using *:E, I catch all the errors and fine-tune the verbosity level for the relevant tags. I use that with an reasonable terminal history size and the excellent coloredlogcat python script. Using the terminal, just moving to the focused lines stop the automatic scrolling without stopping the logging… I have just to move to the latest lines or press some key to get the automatic scrolling again.

Stichter answered 1/11, 2011 at 0:46 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.