summaryrefslogtreecommitdiff
path: root/src/main.py
diff options
context:
space:
mode:
authorCaptainJack2491 <jayrupnakawala@gmail.com>2026-03-01 23:36:14 +0000
committerCaptainJack2491 <jayrupnakawala@gmail.com>2026-03-01 23:44:39 +0000
commit3d8b71ac0921c6df64699dde6447c9effbbc54b7 (patch)
tree77b141f6c3c7e25beb02dbb06e9897a841a2eec0 /src/main.py
parent01c4effadae7cf98e229a0ab2fae857e26a7e055 (diff)
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
Diffstat (limited to 'src/main.py')
-rw-r--r--src/main.py16
1 files changed, 16 insertions, 0 deletions
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")