Skip to content

Instantly share code, notes, and snippets.

@bdelacretaz
Created October 26, 2012 13:46
Show Gist options
  • Save bdelacretaz/3958914 to your computer and use it in GitHub Desktop.
Save bdelacretaz/3958914 to your computer and use it in GitHub Desktop.
Colorize log files using ack - by @alexkli
#!/bin/bash
# colorize log files using ack - by @alexkli
# based on http://powdahound.com/2009/10/colorize-log-output-with-ack
cat - \
| ack --flush --passthru --color --color-match=red "^.*\*ERROR\*.*" \
| ack --flush --passthru --color --color-match=yellow "^.*\*WARN\*.*" \
| ack --flush --passthru --color --color-match=green "^.*\*INFO\*.*" \
| ack --flush --passthru --color --color-match=white "^.*\*DEBUG\*.*" \
| ack --flush --passthru --color --color-match=white "^.*\*TRACE\*.*"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment