Skip to content

Commit b30ea01

Browse files
feat(logging): tracing diagnostics with --log-format/--log-level (#51) (#124)
Add tracing + tracing-subscriber. Global --log-format=pretty|json and --log-level flags (precedence --log-level > RUST_LOG > info). The subscriber writes to stderr so the stdout data contract is never contaminated: JSON reports, the version string, the octad table, and the status/gc/validate report bodies stay on stdout verbatim. Only genuine diagnostics (schema parsing, file-write progress, "checking drift", "created manifest") become tracing events. JSON log schema documented in docs/logging.adoc + docs/logging.schema.json. New acceptance suite tests/logging_test.rs (6 tests): stdout purity, JSON-line schema validity, level filtering, RUST_LOG precedence. Closes #51. Co-authored-by: hyperpolymath <hyperpolymath@users.noreply.github.com> Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
1 parent ff71517 commit b30ea01

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ thiserror = "2"
2222
chrono = { version = "0.4", features = ["serde"] }
2323
sha2 = "0.10"
2424
rusqlite = { version = "0.32", features = ["bundled", "hooks"] }
25-
sqlparser = "0.50"
25+
tracing = "0.1"
26+
tracing-subscriber = { version = "0.3", features = ["env-filter", "json"] }
2627

2728
[build-dependencies]
2829
chrono = "0.4"

0 commit comments

Comments
 (0)