Build bold palette automatically

kivy_mainline_and_py3.8
Tyler Goodlet 2018-01-22 21:59:16 -05:00
parent 570d879146
commit c7258f3fb2
1 changed files with 4 additions and 10 deletions

View File

@ -1,6 +1,6 @@
""" """
Log like a forester! Log like a forester!
(HINT: You can't usually find stupid suits in the forest) (You can't usually find stupid suits in the forest)
""" """
import sys import sys
import logging import logging
@ -8,7 +8,6 @@ import colorlog
_proj_name = 'piker' _proj_name = 'piker'
# Super sexy formatting thanks to ``colorlog``. # Super sexy formatting thanks to ``colorlog``.
# (NOTE: we use the '{' format style) # (NOTE: we use the '{' format style)
# Here, `thin_white` is just the laymen's gray. # Here, `thin_white` is just the laymen's gray.
@ -29,22 +28,17 @@ LEVELS = {
'QUIET': 1000, 'QUIET': 1000,
} }
STD_PALETTE = { STD_PALETTE = {
'CRITICAL': 'bold_red', 'CRITICAL': 'red',
'ERROR': 'red', 'ERROR': 'red',
'WARNING': 'yellow', 'WARNING': 'yellow',
'INFO': 'green', 'INFO': 'green',
'DEBUG': 'purple', 'DEBUG': 'purple',
'TRACE': 'cyan', 'TRACE': 'cyan',
'GARBAGE': 'blue',
} }
BOLD_PALETTE = { BOLD_PALETTE = {
'bold': { 'bold': {
'CRITICAL': 'bold_red', level: f"bold_{color}" for level, color in STD_PALETTE.items()}
'ERROR': 'bold_red',
'WARNING': 'bold_yellow',
'INFO': 'bold_green',
'DEBUG': 'bold_purple',
'TRACE': 'bold_cyan',
},
} }