mirror of
https://github.com/freqtrade/freqtrade.git
synced 2025-11-29 08:33:07 +00:00
Allow warning messages when starting backtesting
This commit is contained in:
@@ -9,8 +9,8 @@ class LoggingMixin:
|
|||||||
Shows similar messages only once every `refresh_period`.
|
Shows similar messages only once every `refresh_period`.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# Disable output completely
|
# Disable INFO output when False
|
||||||
show_output = True
|
show_info_output = True
|
||||||
|
|
||||||
def __init__(self, logger, refresh_period: int = 3600):
|
def __init__(self, logger, refresh_period: int = 3600):
|
||||||
"""
|
"""
|
||||||
@@ -35,6 +35,10 @@ class LoggingMixin:
|
|||||||
|
|
||||||
# Log as debug first
|
# Log as debug first
|
||||||
self.logger.debug(message)
|
self.logger.debug(message)
|
||||||
# Call hidden function.
|
|
||||||
if self.show_output:
|
# 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:
|
||||||
_log_once(message)
|
_log_once(message)
|
||||||
|
|||||||
@@ -114,7 +114,7 @@ class Backtesting:
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, config: Config, exchange: Exchange | None = None) -> None:
|
def __init__(self, config: Config, exchange: Exchange | None = None) -> None:
|
||||||
LoggingMixin.show_output = False
|
LoggingMixin.show_info_output = False
|
||||||
self.config = config
|
self.config = config
|
||||||
self.results: BacktestResultType = get_BacktestResultType_default()
|
self.results: BacktestResultType = get_BacktestResultType_default()
|
||||||
self.trade_id_counter: int = 0
|
self.trade_id_counter: int = 0
|
||||||
@@ -235,7 +235,7 @@ class Backtesting:
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def cleanup():
|
def cleanup():
|
||||||
LoggingMixin.show_output = True
|
LoggingMixin.show_info_output = True
|
||||||
enable_database_use()
|
enable_database_use()
|
||||||
|
|
||||||
def init_backtest_detail(self) -> None:
|
def init_backtest_detail(self) -> None:
|
||||||
|
|||||||
Reference in New Issue
Block a user