understanding logcat output when written to file

自闭症网瘾萝莉.ら 提交于 2019-11-29 18:02:06

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:

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

What you are seeing is a stacktrace. AT the top you have the last known place the app was running at. You have at line 857, you forgot to cast or doing something else there.

The text after the hash are just the error or warning messages like you correctly assumed. The number in the bracket is the line.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!