0

I have read this: Read logcat programmatically within application as well as others and googled for answers. I find close, but no cigar.

I'm parsing a log entry from the Android log. Here's an example:

D/WifiStateMachine(  923): processMsg: ConnectedState

What is the 923? My guess is PID, but I can't verify.

Community
  • 1
  • 1
Thom
  • 14,013
  • 25
  • 105
  • 185

2 Answers2

3

It is the PID. See the logcat output format options for details. You can also have it show you the thread ID along with the PID.

Larry Schiefer
  • 15,687
  • 2
  • 27
  • 33
0

I got curious and wanted a bit more "proof" since the documentation doesn't specifically mention that that number is the PID. I looked up the source of the log formatting function, and it is indeed and unsurprisingly the PID.

switch (p_format->format) {

    ...

    case FORMAT_BRIEF:
    default:
        prefixLen = snprintf(prefixBuf, sizeof(prefixBuf),
            "%c/%-8s(%5d): ", priChar, entry->tag, entry->pid);
        strcpy(suffixBuf, "\n");
        suffixLen = 1;
        break;
}
Patrik Oldsberg
  • 1,540
  • 12
  • 14