9.14 Logging, stages and verbosity
The logger writes colored terminal output and an append-as-you-go transcript. Before a transcript is attached, lines are buffered; attachment flushes them so startup context is retained. Failures before output preparation report that no log file was attached, requiring external console capture.
Levels
The internal levels are error, warning, information, debug and trace. The default terminal level is information. -v, -vv and -vvv expose progressively more diagnostics; quiet/suppress-console settings change terminal display while the transcript remains the durable record.
Debug output includes numerical repairs such as ridge magnitude and pseudoinverse rank. Trace output can be expensive to compute or voluminous; use it for reduced fixtures rather than blindly on a full production run.
Stages
Every log line carries the current pipeline stage. Stage markers can include [current/total], and progress lines include completed units, total, percentage and label. A failure records stage, exit code class, hint and transcript location.
Volatile fields
Elapsed time, start timestamp, process-derived log token and absolute paths can vary across runs. Do not use raw log hashes as the sole test of numerical reproducibility. Parse stable facts or normalize volatile fields in a derived test artifact while preserving the original log.
Thread safety
Logging state is protected by a mutex, serializing transcript writes. Message ordering from parallel workers can reflect completion order; scientific tables must not depend on log order.
Common mistakes
- Hashing logs and declaring numerical non-reproducibility.
- Omitting debug logs when diagnosing matrix stabilization.
- Modifying the original transcript to remove volatile fields.
Checklist
- Preserve the complete original transcript.
- Use stage and exit code to classify failures.
- Normalize only a copied artifact for automated comparison.
Further reading
See matrix stabilization, hash identity and Chapter 7's error/logging guidance.