2013-04-07 88 views
0

背景:我正尝试通过致电log.d来调用我正在使用的Android应用的一些消息。 Logcat显示许多消息,但没有从我的应用程序。最后我试过这个:为什么警告和错误日志消息显示而没有其他消息?

// test logging 
Log.e("taptimer debug", "debug message:program init:error"); 
Log.w("taptimer debug", "debug message:program init:warning"); 
Log.i("taptimer debug", "debug message:program init:info"); 
Log.d("taptimer debug", "debug message:program init:debug"); 
Log.v("taptimer debug", "debug message:program init:verbose"); 
Log.wtf("taptimer debug", "debug message:program init:what a terrible failure!"); 
System.out.println("Println debug:program init"); 

令我惊讶的是,Logcat显示了来自警告和错误级别的消息。为什么这些表演和其他表演都没有?

感谢您的帮助。

+0

你有一个'ANDROID_LOG_TAGS'环境变量设置? 'adb logcat'是否显示全套信息?另见http://stackoverflow.com/questions/14752645/where-are-logcat-filters-applied/14764756#14764756 – fadden 2013-05-02 22:15:08

回答

0

选择verbose为菜单最低日志级别:

enter image description here

此外,还要确保你没有上(左侧菜单)消息过滤器。


如果不起作用,请检查Log.isLoggable()的结果。 如果返回false,你必须与adb手动激活它:

adb shell 
setprop log.tag.taptimer VERBOSE 
+0

感谢您的回应。我没有设置过滤器,并在下拉列表中选择了详细信息。我仍然只收到错误和警告消息。 – steamPickle 2013-04-07 16:11:51