diff --git a/freqtrade/loggers/set_log_levels.py b/freqtrade/loggers/set_log_levels.py index d666361b6..7311fa0a0 100644 --- a/freqtrade/loggers/set_log_levels.py +++ b/freqtrade/loggers/set_log_levels.py @@ -50,6 +50,6 @@ def restore_verbosity_for_bias_tester() -> None: Restore verbosity after bias tester. """ logger.info("Restoring log verbosity.") - log_level = logging.getLogger('freqtrade').getEffectiveLevel() + log_level = logging.NOTSET for logger_name in __BIAS_TESTER_LOGGERS: logging.getLogger(logger_name).setLevel(log_level) diff --git a/tests/test_log_setup.py b/tests/test_log_setup.py index 2ce06b6b0..af9c43fbd 100644 --- a/tests/test_log_setup.py +++ b/tests/test_log_setup.py @@ -133,16 +133,17 @@ def test_set_loggers_journald_importerror(import_fails): def test_reduce_verbosity(): + setup_logging_pre() reduce_verbosity_for_bias_tester() - assert logging.getLogger('freqtrade.resolvers').level is logging.WARNING - assert logging.getLogger('freqtrade.strategy.hyper').level is logging.WARNING + assert logging.getLogger('freqtrade.resolvers').getEffectiveLevel() is logging.WARNING + assert logging.getLogger('freqtrade.strategy.hyper').getEffectiveLevel() is logging.WARNING # base level wasn't changed - assert logging.getLogger('freqtrade').level is logging.INFO + assert logging.getLogger('freqtrade').getEffectiveLevel() is logging.INFO restore_verbosity_for_bias_tester() - assert logging.getLogger('freqtrade.resolvers').level is logging.INFO - assert logging.getLogger('freqtrade.strategy.hyper').level is logging.INFO - assert logging.getLogger('freqtrade').level is logging.INFO + assert logging.getLogger('freqtrade.resolvers').getEffectiveLevel() is logging.INFO + assert logging.getLogger('freqtrade.strategy.hyper').getEffectiveLevel() is logging.INFO + assert logging.getLogger('freqtrade').getEffectiveLevel() is logging.INFO # base level wasn't changed