Created
August 15, 2016 15:43
-
-
Save al-the-x/73b51da8662480ac144aa5080a8eb2c5 to your computer and use it in GitHub Desktop.
Colorize the output of any log with `ack` by piping to `colorize-log`
This file contains 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
function colorize-log { | |
colorize red ERROR | \ | |
colorize yellow 'WARN(ING)?' | \ | |
colorize green INFO | \ | |
colorize white DEBUG | \ | |
colorize white TRACE | |
} |
This file contains 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
function colorize { | |
COLOR="$1"; shift | |
ack --flush --passthru --color --color-match="$COLOR" $@ | |
} |
I wrote a blog post about this!
http://thoughts.al-the-x.me/post/148985003356/colorizing-log-output-from-google-appengine
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If you don't like my color choices, feel free to check out your options: http://stackoverflow.com/questions/9625316/what-color-options-exist-for-ack-grep-for-colorization-of-output-logs-etc