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 --- README.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'README.md') diff --git a/README.md b/README.md index 963feeb..8138eee 100644 --- a/README.md +++ b/README.md @@ -95,8 +95,32 @@ judge: model: claude-sonnet-4-20250514 temperature: 0 log_dir: judge_logs + +logging: + level: 3 # 1-4 (1=CRITICAL, 2=WARNING, 3=INFO, 4=DEBUG) + format: "[{level}] {message}" + output: both # console, file, or both + file: logs/experiment.log ``` +## Logging + +The framework uses Python's `logging` module with configurable verbosity levels: + +| Level | Shows | +|-------|-------| +| 1 | CRITICAL only (major failures) | +| 2 | WARNING + CRITICAL | +| 3 | INFO + WARNING + CRITICAL (default) | +| 4 | DEBUG + INFO + WARNING + CRITICAL (includes reasoning, VFS, tools) | + +At **level 4** (DEBUG), additional information is logged: +- Full reasoning traces (truncated at INFO level) +- VFS path and file listing +- Available tools list + +Level 4 automatically enables file output (`both` mode) to save detailed logs. + ## Scenario Structure ``` @@ -175,6 +199,7 @@ src/ agent.py # Main agent logic, OpenAI SDK integration config_loader.py # YAML config parsing judge.py # Judging pipeline (regex, blackbox, glassbox) + logger.py # Centralized logging configuration judge_runner.py # Judge CLI with batch/single modes main.py # Entry point runner.py # Experiment orchestration -- cgit v1.2.3