简体   繁体   English

如何避免在logCat中隐藏日志?

[英]How to avoid hiding logs in logCat?

I have a problem with my Eclipse. 我的Eclipse有问题。 LogCat just holds messages about 10 seconds and after that they will disappear before i can read them. LogCat仅保留大约10秒钟的消息,在此之后它们将消失,我无法阅读它们。

Anyone knows how to avoid hiding logCat messages? 有谁知道如何避免隐藏logCat消息?

Edit:I don't know what's going wrong with my LogCat. 编辑:我不知道我的LogCat怎么了。 When i connect my galaxy s2 device it shows around 1000 messages in just 2 or 3 seconds! 当我连接galaxy s2设备时,它仅在2到3秒钟内就会显示约1000条消息!

here is one of them.they are mostly like this: 这是其中之一。它们大多是这样的:

01-24 16:56:47.353: D/(2001): [HYPOS] NOMOVE Time 24653125, PowerMode 2, GPSWeakSignal 54, GPSFixTime 0, IsPedestrian 0, DOE 3editcode here

LogCat view got limit on number of lines it keeps in scroll buffer. LogCat视图在滚动缓冲区中保留的行数受到限制。 By default it is set to 5000 lines. 默认情况下,它设置为5000行。 On some devices, where activity is high, this can be not sufficient. 在某些活动频繁的设备上,这可能是不够的。 To increase the limit go to Ecplise settings: Window -> Preferences -> LogCat and increase value of Maximum number of logcat messages . 要增加限制,请转到“ Ecplise设置”: Window -> Preferences -> LogCat并增加Maximum number of logcat messages值。

Note that freezing autoscroll is NOT a solution. 请注意,冻结自动滚动不是解决方案。 You just freeze the autoscroll but data are still being read from the device and placed in logcat buffer. 您只是冻结了自动滚动,但仍从设备读取数据并将其放置在logcat缓冲区中。

Another option is the use of the following command in command prompt which will provide you all logs, 另一个选择是在命令提示符下使用以下命令,它将为您提供所有日志,

adb logcat > LogFileName.txt 亚行logcat> LogFileName.txt

Again you can customize this based on your device or emulator names when more than one devices or emulators are available by specifying their names. 同样,当有多个设备或仿真器可用时,可以通过指定其名称来自定义设备或仿真器的名称。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM