Created
December 14, 2015 16:34
-
-
Save manuartero/9b07879375775c904fbc to your computer and use it in GitHub Desktop.
log path_to_log_file
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 | |
# $1 path_to_log_file | |
if [ -z "$1" ] ; then | |
echo "log {path_to_log_file}" | |
exit 1 | |
fi | |
tail -f -n 10000 $1 | awk ' | |
/DEBUG/ {print "\033[36m" $0 "\033[39m"} | |
/INFO/ {print "\033[32m" $0 "\033[39m"} | |
/WARN/ {print "\033[33m" $0 "\033[39m"} | |
/ERROR/ {print "\033[31m" $0 "\033[39m"} | |
' | less -R |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment