是否有任何配置我可以做logcat显示AndroidRuntime异常?

时间:2013-10-24 13:20:37

标签: android-logcat runtimeexception

有很多次我在android开发中遇到一个未捕获的异常,它导致线程退出而没有进一步的调试信息。目前我的logcat中的消息如下所示:

  

10-24 21:06:56.762:W / dalvikvm(8806):threadid = 25:线程退出时未捕获异常(group = 0x410a8438)

然而,当我在互联网上搜索试图找到如何调试类似的消息时,人们通常发布类似“

”的内容
04-25 19:35:02.353: W/dalvikvm(5650): threadid=1: thread exiting with uncaught exception (group=0x40a71930)
04-25 19:35:02.393: E/AndroidRuntime(5650): FATAL EXCEPTION: main
04-25 19:35:02.393: E/AndroidRuntime(5650): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.least/com.example.least.MainActivity}: android.os.NetworkOnMainThreadException
04-25 19:35:02.393: E/AndroidRuntime(5650):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2180)
04-25 19:35:02.393: E/AndroidRuntime(5650):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
04-25 19:35:02.393: E/AndroidRuntime(5650):     at android.app.ActivityThread.access$600(ActivityThread.java:141)
04-25 19:35:02.393: E/AndroidRuntime(5650):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
04-25 19:35:02.393: E/AndroidRuntime(5650):     at android.os.Handler.dispatchMessage(Handler.java:99)
04-25 19:35:02.393: E/AndroidRuntime(5650):     at android.os.Looper.loop(Looper.java:137)
04-25 19:35:02.393: E/AndroidRuntime(5650):     at android.app.ActivityThread.main(ActivityThread.java:5041)
04-25 19:35:02.393: E/AndroidRuntime(5650):     at java.lang.reflect.Method.invokeNative(Native Method)
04-25 19:35:02.393: E/AndroidRuntime(5650):     at java.lang.reflect.Method.invoke(Method.java:511)
04-25 19:35:02.393: E/AndroidRuntime(5650):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
04-25 19:35:02.393: E/AndroidRuntime(5650):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
04-25 19:35:02.393: E/AndroidRuntime(5650):     at dalvik.system.NativeStart.main(Native Method)
04-25 19:35:02.393: E/AndroidRuntime(5650): Caused by: android.os.NetworkOnMainThreadException
04-25 19:35:02.393: E/AndroidRuntime(5650):     at android.os.StrictMode$AndroidBlockGuardPolicy.onNetwork(StrictMode.java:1117)
04-25 19:35:02.393: E/AndroidRuntime(5650):     at java.net.InetAddress.lookupHostByName(InetAddress.java:385)
04-25 19:35:02.393: E/AndroidRuntime(5650):     at java.net.InetAddress.getAllByNameImpl(InetAddress.java:236)
04-25 19:35:02.393: E/AndroidRuntime(5650):     at java.net.InetAddress.getAllByName(InetAddress.java:214)
04-25 19:35:02.393: E/AndroidRuntime(5650):     at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:137)
04-25 19:35:02.393: E/AndroidRuntime(5650):     at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:164)
04-25 19:35:02.393: E/AndroidRuntime(5650):     at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:119)

后者显然包含了更多有用的调试信息,这通常由“由...引起”子句提示,而我的logcat输出除了模糊下面的实际问题外什么也没做,尽管事实上我已经将调试级别设置为详细。

这是配置问题吗?如何配置我的logcat以显示更具暗示性的内容?

0 个答案:

没有答案