Skip to content

Instantly share code, notes, and snippets.

@rightfold
Last active August 29, 2015 14:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rightfold/76181b9cccb8fefe4b3c to your computer and use it in GitHub Desktop.
Save rightfold/76181b9cccb8fefe4b3c to your computer and use it in GitHub Desktop.
function colored(color, str) {
printf "%c[%dm" str "%c[0m\n", 27, color, 27;
}
/DEBUG/ { colored(37, $0); next }
/INFO/ { colored(34, $0); next }
/WARNING/ { colored(33, $0); next }
/ERROR/ { colored(31, $0); next }
/CRITICAL/ { colored(35, $0); next }
{ print; next }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment