diff --git a/freqtrade/mixins/logging_mixin.py b/freqtrade/mixins/logging_mixin.py index e9a30d471..58399e738 100644 --- a/freqtrade/mixins/logging_mixin.py +++ b/freqtrade/mixins/logging_mixin.py @@ -9,8 +9,8 @@ class LoggingMixin: Shows similar messages only once every `refresh_period`. """ - # Disable INFO output when False - show_info_output = True + # Disable output completely + show_output = True def __init__(self, logger, refresh_period: int = 3600): """ @@ -35,10 +35,6 @@ class LoggingMixin: # Log as debug first self.logger.debug(message) - - # Determine if this is an INFO level message - is_info_message = getattr(logmethod, "__name__", "") == "info" - - # For INFO messages, respect show_info_output flag - if not is_info_message or self.show_info_output: + # Call hidden function. + if self.show_output: _log_once(message) diff --git a/freqtrade/optimize/backtesting.py b/freqtrade/optimize/backtesting.py index 92a9cf261..9326c0840 100644 --- a/freqtrade/optimize/backtesting.py +++ b/freqtrade/optimize/backtesting.py @@ -114,7 +114,7 @@ class Backtesting: """ def __init__(self, config: Config, exchange: Exchange | None = None) -> None: - LoggingMixin.show_info_output = False + LoggingMixin.show_output = False self.config = config self.results: BacktestResultType = get_BacktestResultType_default() self.trade_id_counter: int = 0 @@ -235,7 +235,7 @@ class Backtesting: @staticmethod def cleanup(): - LoggingMixin.show_info_output = True + LoggingMixin.show_output = True enable_database_use() def init_backtest_detail(self) -> None: diff --git a/freqtrade/plugins/pairlist/IPairList.py b/freqtrade/plugins/pairlist/IPairList.py index 89a9e68cd..dff3e41e4 100644 --- a/freqtrade/plugins/pairlist/IPairList.py +++ b/freqtrade/plugins/pairlist/IPairList.py @@ -237,6 +237,11 @@ class IPairList(LoggingMixin, ABC): :return: the list of pairs the user wants to trade without those unavailable or black_listed """ + + # Save show_output value and set it to True + prev_show_output = self.show_output + self.show_output = True + markets = self._exchange.markets if not markets: raise OperationalException( @@ -277,5 +282,8 @@ class IPairList(LoggingMixin, ABC): if pair not in sanitized_whitelist: sanitized_whitelist.append(pair) + # Return show_output to its previous value + self.show_output = prev_show_output + # We need to remove pairs that are unknown return sanitized_whitelist