Logging discipline: log level selection, structured fields, what to log vs what not to log, and the specific logging anti-patterns Claude defaults to. Corrects flat log levels, over-logging, string interpolation, and log-and-propagate. Use when adding logging, reviewing log output, or designing observability. Triggers: log, logging, tracing, log level, info, debug, warn, error, trace, structured logging, observability, correlation id, span, instrument.
Instalación
Instalar con Codex o Claude Copia este prompt, pégalo en Codex, Claude u otro asistente, y deja que revise la página de la skill y la instale por ti.
Logging discipline: log level selection, structured fields, what to log vs what not to log, and the specific logging anti-patterns Claude defaults to. Corrects flat log levels, over-logging, string interpolation, and log-and-propagate. Use when adding logging, reviewing log output, or designing observability. Triggers: log, logging, tracing, log level, info, debug, warn, error, trace, structured logging, observability, correlation id, span, instrument.
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