Skip to content

Instantly share code, notes, and snippets.

@jcgregorio
Last active August 7, 2017 17:48
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 jcgregorio/75c994b4651d93245736 to your computer and use it in GitHub Desktop.
Save jcgregorio/75c994b4651d93245736 to your computer and use it in GitHub Desktop.
Colorizes glogs as they pass through.
#!/bin/sh
# Since glog emits to stderr you'll need to run this through:
# 2>&1 | colorlogs
awk '
/^I/ {print "\033[32m" $0 "\033[39m"}
/^W/ {print "\033[33m" $0 "\033[39m"}
/^E/ {print "\033[31m" $0 "\033[39m"}
'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment