logs to default_logger
This commit is contained in:
@@ -18,7 +18,7 @@ from .example_strategies import get_all_example_strategies
|
||||
from utils.logger import get_logger
|
||||
|
||||
# Initialize logger
|
||||
logger = get_logger("error_handling")
|
||||
logger = get_logger("default_logger")
|
||||
|
||||
|
||||
class ErrorSeverity(str, Enum):
|
||||
@@ -133,7 +133,7 @@ class ConfigurationErrorHandler:
|
||||
self.indicator_names = set(self.available_indicators.keys())
|
||||
self.strategy_names = set(self.available_strategies.keys())
|
||||
|
||||
logger.info(f"Error handler initialized with {len(self.indicator_names)} indicators and {len(self.strategy_names)} strategies")
|
||||
logger.info(f"Error Handling: Error handler initialized with {len(self.indicator_names)} indicators and {len(self.strategy_names)} strategies")
|
||||
|
||||
def validate_strategy_exists(self, strategy_name: str) -> Optional[ConfigurationError]:
|
||||
"""Check if a strategy exists and provide guidance if not."""
|
||||
|
||||
@@ -17,7 +17,7 @@ from data.common.data_types import OHLCVCandle
|
||||
from utils.logger import get_logger
|
||||
|
||||
# Initialize logger
|
||||
logger = get_logger("indicator_defs")
|
||||
logger = get_logger("default_logger")
|
||||
|
||||
|
||||
class IndicatorType(str, Enum):
|
||||
@@ -466,10 +466,10 @@ def convert_database_candles_to_ohlcv(candles: List[Dict[str, Any]]) -> List[OHL
|
||||
ohlcv_candles.append(ohlcv_candle)
|
||||
|
||||
except Exception as e:
|
||||
logger.error(f"Error converting candle to OHLCV: {e}")
|
||||
logger.error(f"Indicator Definitions: Error converting candle to OHLCV: {e}")
|
||||
continue
|
||||
|
||||
logger.debug(f"Converted {len(ohlcv_candles)} database candles to OHLCV format")
|
||||
logger.debug(f"Indicator Definitions: Converted {len(ohlcv_candles)} database candles to OHLCV format")
|
||||
return ohlcv_candles
|
||||
|
||||
|
||||
@@ -488,13 +488,13 @@ def calculate_indicators(candles: List[Dict[str, Any]],
|
||||
Dictionary mapping indicator names to their calculation results
|
||||
"""
|
||||
if not candles:
|
||||
logger.warning("No candles provided for indicator calculation")
|
||||
logger.warning("Indicator Definitions: No candles provided for indicator calculation")
|
||||
return {}
|
||||
|
||||
# Convert to OHLCV format
|
||||
ohlcv_candles = convert_database_candles_to_ohlcv(candles)
|
||||
if not ohlcv_candles:
|
||||
logger.error("Failed to convert candles to OHLCV format")
|
||||
logger.error("Indicator Definitions: Failed to convert candles to OHLCV format")
|
||||
return {}
|
||||
|
||||
# Initialize technical indicators calculator
|
||||
@@ -511,20 +511,20 @@ def calculate_indicators(candles: List[Dict[str, Any]],
|
||||
chart_config = all_configs[indicator_name]
|
||||
configs_to_calculate[indicator_name] = chart_config.to_indicator_config()
|
||||
else:
|
||||
logger.warning(f"Unknown indicator configuration: {indicator_name}")
|
||||
logger.warning(f"Indicator Definitions: Unknown indicator configuration: {indicator_name}")
|
||||
|
||||
if not configs_to_calculate:
|
||||
logger.warning("No valid indicator configurations found")
|
||||
logger.warning("Indicator Definitions: No valid indicator configurations found")
|
||||
return {}
|
||||
|
||||
# Calculate indicators
|
||||
try:
|
||||
results = indicators_calc.calculate_multiple_indicators(ohlcv_candles, configs_to_calculate)
|
||||
logger.debug(f"Calculated {len(results)} indicators successfully")
|
||||
logger.debug(f"Indicator Definitions: Calculated {len(results)} indicators successfully")
|
||||
return results
|
||||
|
||||
except Exception as e:
|
||||
logger.error(f"Error calculating indicators: {e}")
|
||||
logger.error(f"Indicator Definitions: Error calculating indicators: {e}")
|
||||
return {}
|
||||
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ from .defaults import (
|
||||
from utils.logger import get_logger
|
||||
|
||||
# Initialize logger
|
||||
logger = get_logger("strategy_charts")
|
||||
logger = get_logger("default_logger")
|
||||
|
||||
|
||||
class ChartLayout(str, Enum):
|
||||
@@ -117,11 +117,11 @@ class StrategyChartConfig:
|
||||
|
||||
except ImportError:
|
||||
# Fallback to original validation if new system unavailable
|
||||
logger.warning("Enhanced validation system unavailable, using basic validation")
|
||||
logger.warning("Strategy Charts: Enhanced validation system unavailable, using basic validation")
|
||||
return self._basic_validate()
|
||||
except Exception as e:
|
||||
logger.error(f"Validation error: {e}")
|
||||
return False, [f"Validation system error: {e}"]
|
||||
logger.error(f"Strategy Charts: Validation error: {e}")
|
||||
return False, [f"Strategy Charts: Validation system error: {e}"]
|
||||
|
||||
def validate_comprehensive(self) -> 'ValidationReport':
|
||||
"""
|
||||
@@ -173,7 +173,7 @@ class StrategyChartConfig:
|
||||
if indicator_name not in all_default_indicators:
|
||||
errors.append(f"Subplot indicator '{indicator_name}' not found in defaults")
|
||||
except Exception as e:
|
||||
logger.warning(f"Could not validate indicator existence: {e}")
|
||||
logger.warning(f"Strategy Charts: Could not validate indicator existence: {e}")
|
||||
|
||||
# Validate subplot height ratios
|
||||
for i, subplot_config in enumerate(self.subplot_configs):
|
||||
|
||||
@@ -17,7 +17,7 @@ from .strategy_charts import StrategyChartConfig, SubplotConfig, ChartStyle, Cha
|
||||
from utils.logger import get_logger
|
||||
|
||||
# Initialize logger
|
||||
logger = get_logger("config_validation")
|
||||
logger = get_logger("default_logger")
|
||||
|
||||
|
||||
class ValidationLevel(str, Enum):
|
||||
@@ -131,7 +131,7 @@ class ConfigurationValidator:
|
||||
self.available_indicators = get_all_default_indicators()
|
||||
self.indicator_schemas = INDICATOR_SCHEMAS
|
||||
except Exception as e:
|
||||
logger.warning(f"Failed to load indicator information: {e}")
|
||||
logger.warning(f"Validation: Failed to load indicator information: {e}")
|
||||
self.available_indicators = {}
|
||||
self.indicator_schemas = {}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user