Skip to content

Instantly share code, notes, and snippets.

@al-the-x
Created August 15, 2016 15:43
Show Gist options
  • Save al-the-x/73b51da8662480ac144aa5080a8eb2c5 to your computer and use it in GitHub Desktop.
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`
function colorize-log {
colorize red ERROR | \
colorize yellow 'WARN(ING)?' | \
colorize green INFO | \
colorize white DEBUG | \
colorize white TRACE
}
function colorize {
COLOR="$1"; shift
ack --flush --passthru --color --color-match="$COLOR" $@
}
@al-the-x
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment