Created
February 5, 2011 05:22
-
-
Save guilhermechapiewski/812233 to your computer and use it in GitHub Desktop.
"tail -f" a log archive with colored output
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Usage: colored_tail.sh [logfile] | |
tail -f ${1} | perl -pe 's/^\[DEBUG\].*$/\e[35m$&\e[0m/g;s/^\[INFO\].*$/\e[36m$&\e[0m/g;s/^\[WARN\].*$/\e[33m$&\e[0m/g;s/^\[ERROR\].*$/\e[31m$&\e[0m/g;' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment