2013-02-13 103 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行,你忘了在那裏施放或做別的事情。

散列之後的文本只是您正確假定的錯誤或警告消息。括號中的數字是該行。