2013-02-13 107 views
0

我有一个日志猫输出到一个文本文件,但无法找到每个部分的含义。例如,我有以下几点:了解logcat输出时写入文件

W/Trace ( 857): Unexpected value from nativeGetEnabledTags: 0 

E/ActivityThread( 565): Service com.android.exchange.ExchangeService has leaked ServiceConnection [email protected]35408 that was originally bound here 

E/ActivityThread( 565): android.app.ServiceConnectionLeaked: Service com.android.exchange.ExchangeService has leaked ServiceConnection [email protected]35408 that was originally bound here 

E/ActivityThread( 565): at android.app.LoadedApk$ServiceDispatcher.<init>(LoadedApk.java:969) 

我不知道是各个部分我假设W /意味着它的警告,E /意味着它的错误。但不确定文字是否在斜线之后。我也不确定括号中的数字是什么。

感谢您提供的任何帮助。

回答

3

只需将logcat的输出与DDMS中显示的输出进行比较即可轻松理解。这里有一个例子:

logcat的输出:

E/QC-DSS-LIB( 74): unrecognized ifi_index 15 
D/wpa_supplicant(19367): RTM_NEWLINK: operstate=0 ifi_flags=0x11003 ([UP][LOWER_UP]) 
D/wpa_supplicant(19367): RTM_NEWLINK, IFLA_IFNAME: Interface 'eth0' added 
D/wpa_supplicant(19367): Wireless event: cmd=0x8c02 len=27 
D/wpa_supplicant(19367): RTM_NEWLINK: operstate=0 ifi_flags=0x11003 ([UP][LOWER_UP]) 
D/wpa_supplicant(19367): RTM_NEWLINK, IFLA_IFNAME: Interface 'eth0' added 
D/wpa_supplicant(19367): Wireless event: cmd=0x8c02 len=33 
D/WifiStateTracker( 123): Reset connections and stopping DHCP 

DDMS截图: enter image description here

从截图中第一行的分析:

  • “E” 是日志级别
  • QC-DSS-LIB是标签
  • “74”是Process ID

如果你想从logcat中获取时间戳此外,使用-v开关这样的:

logcat -v time 

这将使以这种格式输出:

02-16 09:58:21.446 E/QC-DSS-LIB( 74): unrecognized ifi_index 15 
+0

非常感谢您的帮助。非常感激 – Boardy 2013-02-16 13:38:08

0

你所看到的是一个堆栈跟踪。在顶部你有最后一个已知的地方应用程序正在运行。你在第857行,你忘了在那里施放或做别的事情。

散列之后的文本只是您正确假定的错误或警告消息。括号中的数字是该行。