Readd accidentally dropped StreamHandler
This commit is contained in:
parent
9ad8e74247
commit
122c0e8ddc
@ -1,7 +1,9 @@
|
||||
import logging
|
||||
import queue
|
||||
import sys
|
||||
from logging import Formatter
|
||||
from logging.handlers import RotatingFileHandler, SysLogHandler, BufferingHandler
|
||||
from logging.handlers import (BufferingHandler, RotatingFileHandler,
|
||||
SysLogHandler)
|
||||
from typing import Any, Dict
|
||||
|
||||
from freqtrade.exceptions import OperationalException
|
||||
@ -58,6 +60,9 @@ def setup_logging(config: Dict[str, Any]) -> None:
|
||||
logging.root.addHandler(bufferHandler)
|
||||
|
||||
logfile = config.get('logfile')
|
||||
|
||||
logging.root.addHandler(logging.StreamHandler(sys.stderr))
|
||||
|
||||
if logfile:
|
||||
s = logfile.split(':')
|
||||
if s[0] == 'syslog':
|
||||
|
@ -675,7 +675,7 @@ def test_set_loggers_syslog(mocker):
|
||||
}
|
||||
|
||||
setup_logging(config)
|
||||
assert len(logger.handlers) == 2
|
||||
assert len(logger.handlers) == 3
|
||||
assert [x for x in logger.handlers if type(x) == logging.handlers.SysLogHandler]
|
||||
assert [x for x in logger.handlers if type(x) == logging.StreamHandler]
|
||||
# reset handlers to not break pytest
|
||||
|
Loading…
Reference in New Issue
Block a user