summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDavid Luevano Alvarado <david@luevano.xyz>2022-04-17 23:36:56 -0600
committerDavid Luevano Alvarado <david@luevano.xyz>2022-04-17 23:36:56 -0600
commit435031213cc32c8b598d214d218270367532ad92 (patch)
tree41c8718f869f6ba38a450abde3272374d15210e9 /src
parentdba12a02cc33b45fc9cc1395ee89f317ccf8da96 (diff)
add typing to formatter
Diffstat (limited to 'src')
-rw-r--r--src/pyssg/per_level_formatter.py14
1 files 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}',