Skip to content

Instantly share code, notes, and snippets.

@neodevelop
Created August 29, 2019 17:46
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 neodevelop/4d028ab5d6c4acb426d4efd03250006d to your computer and use it in GitHub Desktop.
Save neodevelop/4d028ab5d6c4acb426d4efd03250006d to your computer and use it in GitHub Desktop.
Colorize the log!!!
tail -f faltas_suplencias.log | awk '
/info/ {print "\033[32m" $0 "\033[39m"}
/debug/ {print "\033[34m" $0 "\033[39m"}
/warn/ {print "\033[33m" $0 "\033[39m"}
/error/ {print "\033[31m" $0 "\033[39m"}
'
tail -f ecto_sql.log | awk '
/SELECT/ {print "\033[32m" $0 "\033[39m"}
/debug/ {print "\033[32m" $0 "\033[39m"}
/INSERT/ {print "\033[34m" $0 "\033[39m"}
/UPDATE/ {print "\033[33m" $0 "\033[39m"}
/error/ {print "\033[31m" $0 "\033[39m"}
'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment