How to disable the autoscroll feature in Logcat?

随声附和 提交于 2019-12-05 08:41:10

问题


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?


回答1:


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.




回答2:


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.




回答3:


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.




回答4:


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.




回答5:


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.



来源:https://stackoverflow.com/questions/6788491/how-to-disable-the-autoscroll-feature-in-logcat

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!