Skip to content

Instantly share code, notes, and snippets.

@s-chizhik
Created April 22, 2015 13:19
Show Gist options
  • Save s-chizhik/1667da72218bbcae4e38 to your computer and use it in GitHub Desktop.
Save s-chizhik/1667da72218bbcae4e38 to your computer and use it in GitHub Desktop.
Add some colors to `tail` output(patterns in fact using for symfony logs)
#/bin/zsh
tail -f $1 \
| GREP_COLORS='mt=01;32' egrep --color=always '[a-zA-Z]*\.DEBUG|' \
| GREP_COLORS='mt=01;34' egrep --color=always '[a-zA-Z]*\.INFO|' \
| GREP_COLORS='mt=01;33' egrep --color=always '[a-zA-Z]*\.WARNING|' \
| GREP_COLORS='mt=01;39;41;' egrep --color=always '[a-zA-Z]*\.CRITICAL|'\
| GREP_COLORS='mt=01;31' egrep --color=always '[a-zA-Z]*\.ERROR|'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment