From c7258f3fb238fde81fdf9bfe9f3fff80cebf4301 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Mon, 22 Jan 2018 21:59:16 -0500 Subject: [PATCH] Build bold palette automatically --- piker/log.py | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/piker/log.py b/piker/log.py index 0fe855bb..5433d69a 100644 --- a/piker/log.py +++ b/piker/log.py @@ -1,6 +1,6 @@ """ 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 logging @@ -8,7 +8,6 @@ import colorlog _proj_name = 'piker' - # Super sexy formatting thanks to ``colorlog``. # (NOTE: we use the '{' format style) # Here, `thin_white` is just the laymen's gray. @@ -29,22 +28,17 @@ LEVELS = { 'QUIET': 1000, } STD_PALETTE = { - 'CRITICAL': 'bold_red', + 'CRITICAL': 'red', 'ERROR': 'red', 'WARNING': 'yellow', 'INFO': 'green', 'DEBUG': 'purple', 'TRACE': 'cyan', + 'GARBAGE': 'blue', } BOLD_PALETTE = { 'bold': { - 'CRITICAL': 'bold_red', - 'ERROR': 'bold_red', - 'WARNING': 'bold_yellow', - 'INFO': 'bold_green', - 'DEBUG': 'bold_purple', - 'TRACE': 'bold_cyan', - }, + level: f"bold_{color}" for level, color in STD_PALETTE.items()} }