.log: more multi-line styling

modden_spawn_from_client_req
Tyler Goodlet 2024-02-20 13:22:44 -05:00
parent 0268b2ce91
commit 54a0a0000d
1 changed files with 10 additions and 2 deletions

View File

@ -289,11 +289,19 @@ def get_console_log(
if not level: if not level:
return log return log
log.setLevel(level.upper() if not isinstance(level, int) else level) log.setLevel(
level.upper()
if not isinstance(level, int)
else level
)
if not any( if not any(
handler.stream == sys.stderr # type: ignore handler.stream == sys.stderr # type: ignore
for handler in logger.handlers if getattr(handler, 'stream', None) for handler in logger.handlers if getattr(
handler,
'stream',
None,
)
): ):
handler = logging.StreamHandler() handler = logging.StreamHandler()
formatter = colorlog.ColoredFormatter( formatter = colorlog.ColoredFormatter(