pidcat icon indicating copy to clipboard operation
pidcat copied to clipboard

Allow input from stdin

Open Kyle-Falconer opened this issue 8 years ago • 6 comments

Feature request

Device logs don't always come directly from ADB. It would be nice to be able to pass in a previously-acquired log for formatting.

Example possible usage:

  • taking input from stdin:
    pidcat < ~/Desktop/logs/crash_dump.txt
  • taking input as an argument:
    pidcat -l ~/Desktop/logs/crash_dump.txt

Kyle-Falconer avatar Aug 14 '17 19:08 Kyle-Falconer

This already works. Are you having a problem with it?

JakeWharton avatar Aug 14 '17 19:08 JakeWharton

Yes, it's not working for me.

I'm running pidcat 2.1.0 on macOS 10.12.5

Kyle-Falconer avatar Aug 14 '17 20:08 Kyle-Falconer

I can not reproduce this issue with pidcat 2.1.0 on Ubuntu Linux.

This works for me:

$ adb logcat > log  # store log
$ pidcat org.example.app < log  # outputs colorized log

@Kyle-Falconer can you share ~/Desktop/logs/crash_dump.txt file and command line that you use to start pidcat?

rutsky avatar Oct 05 '17 15:10 rutsky

Here are the commands I used:

$ adb logcat -d > ~/Desktop/logcat_test.txt
$ pidcat < ~/Desktop/logcat_test.txt
$ tail ~/Desktop/logcat_test.txt
10-10 12:09:58.155  9628 26095 D Babel_db: querying merged_contacts_with_details took 0 ms
10-10 12:09:58.179  9628 26095 D Babel_db: querying merged_contacts_with_details took 1 ms
10-10 12:09:58.199  9628 26095 D Babel_db: querying merged_contacts_with_details took 0 ms
10-10 12:09:58.223  9628 26095 D Babel_db: querying merged_contacts_with_details took 1 ms
10-10 12:09:58.246  9628 26095 D Babel_db: querying merged_contacts_with_details took 1 ms
10-10 12:09:58.269  9628 26095 D Babel_db: querying merged_contacts_with_details took 0 ms
10-10 12:09:58.292  9628 26095 I chatty  : uid=10073(u0_a73) IntentService[M identical 1 line
10-10 12:09:58.316  9628 26095 D Babel_db: querying merged_contacts_with_details took 0 ms
10-10 12:09:58.333  9628 26095 D Babel_db: querying merged_contacts_with_details took 1 ms
10-10 12:09:58.359  9628 26095 D Babel_db: querying merged_contacts_with_details took 0 ms

logcat_test.txt

Also, even if I pass in the package name, which in my case is com.fullmeadalchemist.mustwatch.beta, then it still doesn't work. This app is built in debug mode and uses Timber for outputting the logs. Another app that does not use Timber in debug mode has the same result. The command used for that is:

$ pidcat com.fullmeadalchemist.mustwatch.beta < ~/Desktop/logcat_test.txt

To further attempt to rule out potential issues with my specific environment, I removed everything from my ~/.profile file and included just this:

export ANDROID_HOME="/Users/$USER/Library/Android/sdk/"
export ANDROID_HOME_TOOLS=/Users/$USER/Library/Android/sdk/tools/bin
export ANDROID_PLATFORM_TOOLS=/Users/$USER/Library/Android/sdk/platform-tools
export PATH=$ANDROID_HOME:$ANDROID_HOME_TOOLS:$ANDROID_PLATFORM_TOOLS:$PATH

The issue still remains. Let me know if there's any additional information you need.

Kyle-Falconer avatar Oct 10 '17 19:10 Kyle-Falconer

For me it works with adb logcat -v brief as described here https://stackoverflow.com/a/43679819/1430599

First option doesn't work

zayass avatar Aug 06 '18 13:08 zayass

Hi Guys,

I am unable to parse the logcat from the file as well on macos sierra 10.13.6. These commands don't print any output. pidcat my_package < ~/Desktop/logs/crash_dump.txt

Perhaps someone found the reason why it doesn't work on mac os? Thanks!

nikolai-ivanov avatar Sep 13 '18 14:09 nikolai-ivanov