-
-
Save brain-zhang/8031985 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| 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