From 8eabaa8d9ca33b9a12d7f3e128f08de1edd9384a Mon Sep 17 00:00:00 2001 From: shenjack <3695888@qq.com> Date: Sun, 5 Nov 2023 23:57:13 +0800 Subject: [PATCH] sync lib not dr --- libs/lib_not_dr/logger/logger.py | 2 +- libs/lib_not_dr/logger/outstream.py | 6 +++--- libs/lib_not_dr/logger/structure.py | 5 +++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/libs/lib_not_dr/logger/logger.py b/libs/lib_not_dr/logger/logger.py index f97e47b..31f5dd2 100644 --- a/libs/lib_not_dr/logger/logger.py +++ b/libs/lib_not_dr/logger/logger.py @@ -20,7 +20,7 @@ class Logger(Options): outputs: List[BaseOutputStream] = [] enable: bool = True - level: int = 20 + level: int = 20 # info def log_for(self, level: int) -> bool: """ diff --git a/libs/lib_not_dr/logger/outstream.py b/libs/lib_not_dr/logger/outstream.py index 8741e86..feb4140 100644 --- a/libs/lib_not_dr/logger/outstream.py +++ b/libs/lib_not_dr/logger/outstream.py @@ -28,7 +28,7 @@ __all__ = [ class BaseOutputStream(Options): name = 'BaseOutputStream' - level: int = 10 + level: int = 20 enable: bool = True formatter: BaseFormatter @@ -49,7 +49,7 @@ class BaseOutputStream(Options): class StdioOutputStream(BaseOutputStream): name = 'StdioOutputStream' - level: int = 10 + level: int = 20 formatter: BaseFormatter = StdFormatter() def write_stdout(self, message: LogMessage) -> None: @@ -81,7 +81,7 @@ class StdioOutputStream(BaseOutputStream): class FileCacheOutputStream(BaseOutputStream): name = 'FileCacheOutputStream' - level: int = 10 + level: int = 20 formatter: BaseFormatter = StdFormatter(enable_color=False) text_cache: io.StringIO = None diff --git a/libs/lib_not_dr/logger/structure.py b/libs/lib_not_dr/logger/structure.py index 5b3309d..b8ee936 100644 --- a/libs/lib_not_dr/logger/structure.py +++ b/libs/lib_not_dr/logger/structure.py @@ -6,8 +6,9 @@ import time +from pathlib import Path from types import FrameType -from typing import List, Optional, Tuple, Dict +from typing import List, Optional, Tuple, Dict, Union from lib_not_dr.types.options import Options @@ -92,7 +93,7 @@ class LogMessage(Options): return int(self.log_time / 1000000) % 1000 -FormattingMessage = Tuple[LogMessage, Dict[str, str]] +FormattingMessage = Tuple[LogMessage, Dict[str, Union[str, Path]]] if __name__ == '__main__': print(LogMessage().as_markdown())