Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
570 views
in Technique[技术] by (71.8m points)

android - understanding logcat output when written to file

I have a log cat which is outputted to a text file but can't find anything on what each part means. For example, I have the following:

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

E/ActivityThread(  565): Service com.android.exchange.ExchangeService has leaked ServiceConnection com.android.emailcommon.service.ServiceProxy$ProxyConnection@40d35408 that was originally bound here

E/ActivityThread(  565): android.app.ServiceConnectionLeaked: Service com.android.exchange.ExchangeService has leaked ServiceConnection com.android.emailcommon.service.ServiceProxy$ProxyConnection@40d35408 that was originally bound here

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

I'm not sure what each part means I assume W/ means its a warning and E/ means its an error. But not sure the text is after the slash. I'm also not sure what the number is in the brackets.

Thanks for any help you can provide.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

This can be easily understood by simply comparing the output of logcat with that displayed in DDMS. Here's an example:

Logcat output:

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 screenshot: enter image description here

Analysis of the first line from the screenshot:

  • "E" is the log level
  • QC-DSS-LIB is the tag
  • "74" is the Process ID

If you wish to get the timestamp also from logcat, use the -v switch like this:

logcat -v time

which would give an output in this format:

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...