1

I ran Logcat on a command window and tried all possible formats:

  • brief — Display priority/tag and PID of the process issuing the message (the default format).
  • process — Display PID only.
  • tag — Display the priority/tag only.
  • raw — Display the raw log message, with no other metadata fields.
  • time — Display the date, invocation time, priority/tag, and PID of the process.
  • thread — Display the priority, tag, and the PID and TID.
  • threadtime — Display the date, invocation time, priority, tag, and the PID and TID.
  • long — Display all metadata fields and separate messages with blank lines.

    I could not find in any of those formats how does Eclipse ADT's Logcat figure out what is the name of the Application issuing the message.

    If you use Eclipse, look at the LogCat tab, it has Time, PID, Application, Tag and Text columns.
    Does it use the TID to identify the application? Where can I get the list of TIDs and app names running in the system?

  • ilomambo
    • 8,290
    • 12
    • 57
    • 106

    1 Answers1

    2

    i had about the same question on: https://stackoverflow.com/questions/10366709/android-using-logcat-in-the-command-line-application-info-exact-priority-f

    i'm not sure how it works on eclipse , but you can have a workaround: take from the log which process id was started that matches the package name . the weird thing is that this might be the same way it works there , since for some log messages , eclipse doesn't show which application has written the log message. you might also be able to fetch the package name by pid , but i can't find out the method to do this.

    Community
    • 1
    • 1
    android developer
    • 114,585
    • 152
    • 739
    • 1,270
    • I saw it, **>> adb shell ps [pid]**. It shows all required info – ilomambo May 14 '12 at 09:37
    • It means that if I am making my own LogCat, I have to run one extra command for each log message received, to check it's pid. Because I cannot assume the pid existed when adb logcat was launched. – ilomambo May 14 '12 at 09:39
    • do you know by any chance of a java function to fetch the package name by giving the pid as a parameter? that could help a lot. – android developer May 14 '12 at 09:57
    • maybe this can help [http://stackoverflow.com/questions/8542326/android-how-to-get-the-processname-or-packagename-by-using-pid](http://stackoverflow.com/questions/8542326/android-how-to-get-the-processname-or-packagename-by-using-pid) – ilomambo May 14 '12 at 13:29
    • i see. this could be useful . thanks. wonder if there is a shorter way. – android developer May 14 '12 at 15:39