Created
October 26, 2012 13:46
-
-
Save bdelacretaz/3958914 to your computer and use it in GitHub Desktop.
Colorize log files using ack - by @alexkli
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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