Files
hermes-agent/tools
Teknium c507ee2180 feat: centralized logging to ~/.hermes/logs/
Add hermes_logging.py — single setup_logging() entry point used by CLI,
gateway, and cron.  All Hermes processes now write to two log files:

  agent.log  — INFO+, captures all agent/tool/session activity
  errors.log — WARNING+, quick triage of errors and warnings

Both use RotatingFileHandler with RedactingFormatter (secrets never hit
disk).  The setup is idempotent, so gateway mode (new AIAgent per message)
doesn't duplicate handlers.

Changes:
- New hermes_logging.py with setup_logging(), setup_verbose_logging(),
  and _add_rotating_handler() (all idempotent)
- Add logging: section to DEFAULT_CONFIG (level, max_size_mb, backup_count)
  with config.yaml override support
- run_agent.py: replace 50-line inline logging setup with setup_logging() call
- gateway/run.py: use centralized setup + keep gateway.log as gateway-specific
- cli.py: call setup_logging() at module load (before AIAgent exists)
- hermes_cli/main.py: call setup_logging() early for all subcommands
- Fix debug_helpers.py: use get_hermes_home()/logs instead of ./logs/
- 20 new tests covering handler creation, idempotency, config reading,
  log level filtering, and verbose mode
2026-04-05 22:58:19 -07:00
..