Skip to content

Instantly share code, notes, and snippets.

@tankywoo
Created December 18, 2013 02:07
Show Gist options
  • Save tankywoo/8016220 to your computer and use it in GitHub Desktop.
Save tankywoo/8016220 to your computer and use it in GitHub Desktop.
color print
RESET_COLOR = "\033[0m"
COLOR_CODES = {
"debug" : "\033[1;34m", # blue
"info" : "\033[1;32m", # green
"warning" : "\033[1;33m", # yellow
"error" : "\033[1;31m", # red
"critical" : "\033[1;41m", # background red
}
def color_msg(level, msg):
return COLOR_CODES[level] + msg + RESET_COLOR
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment