Skip to content

Instantly share code, notes, and snippets.

@lukmdo
Last active October 15, 2017 07:19
Show Gist options
  • Save lukmdo/2004269 to your computer and use it in GitHub Desktop.
Save lukmdo/2004269 to your computer and use it in GitHub Desktop.
colorize gae logs filter
#!/usr/bin/env awk -f
# CCZE alternative (https://github.com/cornet/ccze)
BEGIN {
RED="\033[0;31m"
YELLOW="\033[0;33m"
GREEN="\033[0;32m"
BLUE="\033[0;34m"
LIGHT_RED="\033[1;31m"
LIGHT_GREEN="\033[1;32m"
WHITE="\033[1;37m"
LIGHT_GRAY="\033[0;37m"
COLOR_NONE="\033[0m"
}
/^INFO/ { print }
/^WARNING/ { sub("WARNING", YELLOW "WARNING" COLOR_NONE); print }
/^ERROR/ { sub("ERROR", LIGHT_RED "ERROR" COLOR_NONE); print }
/^CRITICAL/ { sub("CRITICAL", RED "CRITICAL" COLOR_NONE); print }
!/(INFO)|(WARNING)|(ERROR)|(CRITICAL)/ { print }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment