From 435031213cc32c8b598d214d218270367532ad92 Mon Sep 17 00:00:00 2001 From: David Luevano Alvarado Date: Sun, 17 Apr 2022 23:36:56 -0600 Subject: add typing to formatter --- src/pyssg/per_level_formatter.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/pyssg/per_level_formatter.py b/src/pyssg/per_level_formatter.py index 2010483..2439bd6 100644 --- a/src/pyssg/per_level_formatter.py +++ b/src/pyssg/per_level_formatter.py @@ -4,14 +4,14 @@ from logging import Formatter class PerLevelFormatter(logging.Formatter): # colors for the terminal in ansi - yellow = "\x1b[33m" - red = "\x1b[31m" - bold_red = "\x1b[31;1m" - reset = "\x1b[0m" + yellow: str = "\x1b[33m" + red: str = "\x1b[31m" + bold_red: str = "\x1b[31;1m" + reset: str = "\x1b[0m" - DATE_FMT = '%Y-%m-%d %H:%M:%S' - COMMON_FMT = '[%(levelname)s] [%(module)s:%(funcName)s:%(lineno)d]: %(message)s' - FORMATS = { + DATE_FMT: str = '%Y-%m-%d %H:%M:%S' + COMMON_FMT: str = '[%(levelname)s] [%(module)s:%(funcName)s:%(lineno)d]: %(message)s' + FORMATS: dict[int, str] = { logging.DEBUG: COMMON_FMT, logging.INFO: '%(message)s', logging.WARNING: f'{yellow}{COMMON_FMT}{reset}', -- cgit v1.2.3-54-g00ecf