From ab3f76a5597240c171b52e538e1b6ac163c5a952 Mon Sep 17 00:00:00 2001 From: Goffi Date: Sat, 4 Mar 2023 18:23:33 +0100 Subject: [PATCH] core (log): type hints --- sat/core/log.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sat/core/log.py b/sat/core/log.py index a0d744fc..25a09133 100644 --- a/sat/core/log.py +++ b/sat/core/log.py @@ -21,7 +21,7 @@ # XXX: this module use standard logging module when possible, but as SàT can work in different cases where logging is not the best choice (twisted, pyjamas, etc), it is necessary to have a dedicated module. Additional feature like environment variables and colors are also managed. # TODO: change formatting from "%s" style to "{}" when moved to Python 3 -from typing import TYPE_CHECKING, Any, Optional +from typing import TYPE_CHECKING, Any, Optional, Dict if TYPE_CHECKING: from logging import _ExcInfoType @@ -34,7 +34,7 @@ from sat.core import exceptions import traceback backend = None -_loggers = {} +_loggers: Dict[str, "Logger"] = {} handlers = {} COLOR_START = '%(color_start)s' COLOR_END = '%(color_end)s' @@ -401,7 +401,7 @@ def memoryGet(size=None): raise ValueError('memory output is not used') return configure_cls[backend].memoryGet(size) -def getLogger(name=C.LOG_BASE_LOGGER): +def getLogger(name=C.LOG_BASE_LOGGER) -> Logger: try: logger_class = configure_cls[backend].LOGGER_CLASS except KeyError: