Skip to content

Instantly share code, notes, and snippets.

@kilfu0701
Created September 23, 2016 02:23
Show Gist options
  • Save kilfu0701/c19e7aa49842bde25a5ef2cc8cdd58ca to your computer and use it in GitHub Desktop.
Save kilfu0701/c19e7aa49842bde25a5ef2cc8cdd58ca to your computer and use it in GitHub Desktop.
Make stdout/stderr with color.
#!/bin/bash
~/go_appengine/dev_appserver.py --port=8081 --admin_port=8001 --datastore_path=/tmp/myapp_datastore . 2>&1 | \
awk '{ gsub("DEBUG", "\033[1;35m&\033[0m");
gsub("INFO", "\033[1;36m&\033[0m");
gsub("ERROR", "\033[1;31m&\033[0m");
gsub("WARNING", "\033[1;33m&\033[0m");
gsub("CRITICAL", "\033[1;31m&\033[0m");
print
}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment