auto-logging
Installation
SKILL.md
Contains Shell Commands
This skill contains shell command directives (!`command`) that may execute system commands. Review carefully before installing.
Logging — What Claude Gets Wrong
You log everything at info!. You log in loops. You narrate success paths at the same verbosity as failures. You use string interpolation instead of structured fields. This skill fixes all of it.
Log Level Selection
The two tests:
- ERROR: "Would I wake someone up for this?" — Yes → ERROR
- INFO: "Would I want this line in production at normal load?" — Yes → INFO
| Level | When | Example |
|---|---|---|
| ERROR | Operation failed, requires attention, actionable | error!(job_id, err, "inference job failed after all retries") |
| WARN | Degraded but working, approaching limits, recovered failure | warn!(attempt = 3, "retry succeeded for whale_alert fetch") |
| INFO | State transitions, service lifecycle, business milestones | info!(consensus = "BULLISH", agreement = "2/3", "debate completed") |
| DEBUG | Variable states, execution branches, API payloads | debug!(retry_strategy = "exponential", attempt = 2, "retrying") |
| TRACE | Function entry/exit, loop iterations, raw data | trace!(raw_bytes = bytes.len(), "parsing sentinel response") |