Revert allowing multiple stream handlers; clutters test output
parent
8b7bf4fc07
commit
aa8238d5e0
|
@ -1,6 +1,7 @@
|
|||
"""
|
||||
Log like a forester!
|
||||
"""
|
||||
import sys
|
||||
from functools import partial
|
||||
import logging
|
||||
import colorlog # type: ignore
|
||||
|
@ -73,6 +74,11 @@ def get_console_log(level: str = None, name: str = None) -> logging.Logger:
|
|||
return log
|
||||
|
||||
log.setLevel(level.upper() if not isinstance(level, int) else level)
|
||||
|
||||
if not any(
|
||||
handler.stream == sys.stderr for handler in log.handlers
|
||||
if getattr(handler, 'stream', None)
|
||||
):
|
||||
handler = logging.StreamHandler()
|
||||
formatter = colorlog.ColoredFormatter(
|
||||
LOG_FORMAT,
|
||||
|
|
Loading…
Reference in New Issue