A python script which outputs logcat message in color
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
README.md
coloredlogcat.py
endless.sh
example.png

README.md

Colored Logcat

A python script which outputs logcat messages in color.

This script was originally written by Jeff Sharkey and can be found here.

I changed the code substantially in order to support multiple logcat output formats. The color codes roughly correspond to the usual output (warning = yellow, error = red, ...) now.

example screenshot

Usage

Put coloredlogcat.py in your $PATH.

coloredlogcat.py behaves like plain adb logcat:

$> coloredlogcat.py

$> coloredlogcat.py -v time

Or reads from stdin:

$> cat logfile.log | coloredlogcat.py

$> adb logcat -v time | grep --line-buffered  `adb shell ps | grep com.android.chrome | cut -c 10-15` | coloredlogcat.py

If you restart your app often, you may want to consider putting endless.sh in your $PATH. This script is a wrapper around coloredlogcat.py and expects the app's package name as argument:

$> endless.sh com.android.chrome

Press CTRL+C to restart reading. This allows you to easily follow the app when it was assigned a new pid.

endless.sh briefly echoes its own pid before running logcat which allows you to stop the script with kill.