简体   繁体   English

如何在logcat中显示日志?

[英]How can I show my Logs in my logcat?

Maybe it's a dumb question but I couldn't find the solution. 也许这是一个愚蠢的问题,但我找不到解决方案。

The problem it's that I put logs in all my Android app and it doesn't appear on the logcat . 问题是我将logs放入所有Android应用程序中,并且没有出现在logcat I don't know why now they don't appear because some days ago they appeared normally. 我不知道为什么现在不显示它们,因为几天前它们正常显示了。

I put the logs like: 我把logs像:

Log.d("prove", "this works");

And in the logcat just appears sentences like: 并且在logcat中仅出现如下句子:

ACT-AM_ON_PAUSE_CALLED....
ACT-PAUSE_ACTIVITY_FINISHING....
ACT-AM_ON_RESUME_CALLED....

and similars. 和类似的东西。 The .... refers that the sentences are bigger (they show the activity that it's doing the proccess but I obviate to put here because they are too long). ....表示句子更大(它们显示出正在执行过程的活动,但由于它们太长,我不愿放在此处)。

What could be the problem? 可能是什么问题呢? Maybe a configuration that has been changed? 也许配置已更改? (I didn't change any configuration but maybe I missclick in some botton and change something by error). (我没有更改任何配置,但也许我在某些botton中未按一下,并错误地更改了某些内容)。

Thanks in advance! 提前致谢!

maybe your logs are displayed on console but you can notice them because your console scroll logs so fast. 也许您的日志显示在控制台上,但您会注意到它们,因为控制台滚动日志是如此之快。

Please try use filters for logcat. 请尝试对logcat使用过滤器。 Example: 例:

adb logcat *:S prove:D

Will display only logs from tag "prove" 将仅显示来自标签“ prove”的日志

Such filters can be sets in configuration of the device which you use, set by adb. 可以在您使用的设备配置中通过adb设置此类过滤器。

Maybe it's a dumb answer, but are you sure, that you didn't change logging level (error, verbose etc.)? 也许这是一个愚蠢的答案,但是您确定您没有更改日志记录级别(错误,冗长等)吗? :) :)

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

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