Skip to content

Instantly share code, notes, and snippets.

@itspriddle
Forked from adamv/watch_log.sh
Created November 4, 2010 23:05
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 itspriddle/663361 to your computer and use it in GitHub Desktop.
Save itspriddle/663361 to your computer and use it in GitHub Desktop.
#!/bin/bash
if [ $# -eq 0 ]; then
echo "$0 /path/to/log"
exit
fi
# Escaped color codes
BLACK=`echo -e '\033[0;30m'`
DK_GREY=`echo -e '\033[1;30m'`
RED=`echo -e '\033[0;31m'`
PINK=`echo -e '\033[1;31m'`
GREEN=`echo -e '\033[0;32m'`
LT_GREEN=`echo -e '\033[1;32m'`
BROWN=`echo -e '\033[0;33m'`
YELLOW=`echo -e '\033[1;33m'`
BLUE=`echo -e '\033[0;34m'`
LT_BLUE=`echo -e '\033[1;34m'`
PURPLE=`echo -e '\033[0;35m'`
LT_PURPLE=`echo -e '\033[1;35m'`
CYAN=`echo -e '\033[0;36m'`
LT_CYAN=`echo -e '\033[1;36m'`
LT_GREY=`echo -e '\033[0;37m'`
WHITE=`echo -e '\033[1;37m'`
COLOR_NONE=`echo -e '\033[0m'`
tail -f $1 | sed \
-e "/GET \/favicon.ico/d" \
-e "s/^.* 40[012356789] .*$/$PINK&$COLOR_NONE/" \
-e "s/^.* 404 .*$/$BROWN&$COLOR_NONE/" \
-e "s/^.* 500 .*$/$PURPLE&$COLOR_NONE/"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment