【发布时间】:2015-09-28 08:33:07
【问题描述】:
当我开发 Android 应用程序时,我经常发现日志记录非常困难。 记录消息并不难,但很难看到记录的消息。
可能是因为我使用的是真机调试,logcat 中不断充满消息。我可以将严重性切换为“错误”,这样消息就会减少,但是我看不到“信息”消息!现在我能想到的唯一方法是Log.e 而不是Log.i。但这真的没有意义!
例如,我要显示显示指标:
Point pt = new Point ();
getWindowManager ().getDefaultDisplay ().getSize (pt);
int height = pt.y;
int width = pt.x;
Log.i ("Display Metrics", "Height: " + height);
Log.i ("Display Metrics", "Width: " + width);
我在 logcat 中找不到该消息,因为消息不断出现。我什至不能在这里发布logcat!我应该如何记录内容?
【问题讨论】:
-
如果您使用的是安卓监视器,您可以轻松地从您的应用程序中过滤掉消息,或者使用您的标签...
-
里面有一个过滤窗口
标签: java android logging logcat