From 3d8b71ac0921c6df64699dde6447c9effbbc54b7 Mon Sep 17 00:00:00 2001 From: CaptainJack2491 Date: Sun, 1 Mar 2026 23:36:14 +0000 Subject: feat: add centralized logging with configurable debug levels - Create src/logger.py with Python logging module - Add 4 debug levels: 1=CRITICAL, 2=WARNING, 3=INFO, 4=DEBUG - Level 4 includes reasoning, VFS info, and available tools - Level 4 auto-enables file output (both mode) - Update agent.py and runner.py to use logger instead of print - Update config.yaml.example with logging configuration - Update README with logging documentation --- src/main.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/main.py') diff --git a/src/main.py b/src/main.py index ad4015a..36297bc 100644 --- a/src/main.py +++ b/src/main.py @@ -3,10 +3,26 @@ Main entry point for running experiments. Uses config.yaml to define what to run. """ from runner import run_from_config +from logger import setup_logger +from config_loader import ConfigLoader def main(): """Run all experiments defined in config.yaml.""" + # Load config to get logging settings + config = ConfigLoader("config.yaml") + config.load() + + # Initialize logger + log_config = config.logging_config + setup_logger( + name="experiment", + level=log_config.get('level', 3), + log_format=log_config.get('format', '[{level}] {message}'), + output=log_config.get('output', 'console'), + log_file=log_config.get('file') + ) + run_from_config("config.yaml") -- cgit v1.2.3