"""Logging configuration for the backend.""" import logging import os from pathlib import Path # Log file location log_file = Path("evaluation.log") def configure_root_logger(): """Configure the root logger with file and console handlers.""" logging.basicConfig( level=logging.INFO, format="%(asctime)s - %(name)s - %(levelname)s - %(message)s", handlers=[ logging.FileHandler(log_file), logging.StreamHandler(), ], ) def setup_logger(name: str) -> logging.Logger: """ Set up a logger with the given name. Args: name: Logger name (typically __name__) Returns: Configured logger """ logger = logging.getLogger(name) logger.setLevel(logging.INFO) return logger