mirror of
https://github.com/PaiGramTeam/paigram-logger.git
synced 2024-11-23 16:17:55 +00:00
🐛 Fix some bugs
This commit is contained in:
parent
81d1c1853b
commit
d0b97c33be
@ -33,7 +33,7 @@ class LoggerConfig(BaseSettings):
|
|||||||
|
|
||||||
debug: bool = False
|
debug: bool = False
|
||||||
"""是否 debug"""
|
"""是否 debug"""
|
||||||
width: int = 180
|
width: Optional[int] = None
|
||||||
"""输出时的宽度"""
|
"""输出时的宽度"""
|
||||||
keywords: List[str] = []
|
keywords: List[str] = []
|
||||||
"""高亮的关键字"""
|
"""高亮的关键字"""
|
||||||
|
@ -127,7 +127,7 @@ class Handler(DefaultRichHandler):
|
|||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
*args,
|
*args,
|
||||||
width: int = None,
|
width: Optional[int] = None,
|
||||||
rich_tracebacks: bool = True,
|
rich_tracebacks: bool = True,
|
||||||
locals_max_depth: Optional[int] = None,
|
locals_max_depth: Optional[int] = None,
|
||||||
tracebacks_max_frames: int = 100,
|
tracebacks_max_frames: int = 100,
|
||||||
|
@ -97,7 +97,7 @@ class Logger(logging.Logger):
|
|||||||
datefmt=self.config.time_format,
|
datefmt=self.config.time_format,
|
||||||
handlers=[handler, debug_handler, error_handler],
|
handlers=[handler, debug_handler, error_handler],
|
||||||
)
|
)
|
||||||
if config.capture_warnings:
|
if self.config.capture_warnings:
|
||||||
logging.captureWarnings(True)
|
logging.captureWarnings(True)
|
||||||
warnings_logger = logging.getLogger("py.warnings")
|
warnings_logger = logging.getLogger("py.warnings")
|
||||||
warnings_logger.addHandler(handler)
|
warnings_logger.addHandler(handler)
|
||||||
|
Loading…
Reference in New Issue
Block a user