.log: more multi-line styling
parent
0268b2ce91
commit
54a0a0000d
|
@ -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(
|
||||||
|
|
Loading…
Reference in New Issue