Forked from achristodoulou/Tail logs with color for Monolog
Last active
December 21, 2016 08:43
-
-
Save Loupax/ec45752a5c630f7bda55 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
tail "$@" | awk ' | |
{matched=0} | |
/INFO:/ {matched=1; print "\033[0;37m" $0 "\033[0m"} # WHITE | |
/NOTICE:/ {matched=1; print "\033[0;36m" $0 "\033[0m"} # CYAN | |
/WARNING:/ {matched=1; print "\033[0;34m" $0 "\033[0m"} # BLUE | |
/ERROR:/ {matched=1; print "\033[0;31m" $0 "\033[0m"} # RED | |
/ALERT:/ {matched=1; print "\033[0;35m" $0 "\033[0m"} # PURPLE | |
matched==0 {print "\033[0;33m" $0 "\033[0m"} # YELLOW | |
' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment