1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
//! # dig-logging
//!
//! The shared logging + log-collection building block for the DIG service binaries (`dig-node`,
//! `dig-dns`, `dig-updater`; later `dig-relay`, `digstore`). It is the ONE place those binaries get
//! their logging from, so the sink layout, directory convention, JSONL schema, rotation policy,
//! level control, correlation ids, redaction rules, and `logs` CLI verbs are byte-identical across
//! every binary. `SPEC.md` is the normative contract.
//!
//! It is a thin composition over [`tracing`], [`tracing_subscriber`], and [`tracing_appender`] — it
//! builds ON `tracing`, it does not replace it.
//!
//! ## Quick start
//!
//! ```no_run
//! let _guard = dig_logging::init(dig_logging::Service {
//! name: "dig-node",
//! version: env!("CARGO_PKG_VERSION"),
//! run_context: dig_logging::RunContext::Service,
//! })?;
//! tracing::info!(peer = "203.0.113.7", "serving");
//! # Ok::<(), dig_logging::Error>(())
//! ```
//!
//! `init` installs a dual sink — a structured JSONL file (rolling daily, byte-capped, non-blocking
//! and lossy under backpressure) plus compact human text on `stderr` — behind one reloadable level
//! filter, and stamps a per-run `run_id` (+ `op_id`/`parent_op_id` correlation). Hold the returned
//! [`LogGuard`] for the process lifetime.
//!
//! ## Collection
//!
//! Consumers mount the reusable [`logs`] verbs (`path`/`tail`/`level`/`bundle`) and the [`redact`]
//! engine gives a `logs bundle` a safe, secret-scrubbed zip for a bug report.
pub use ;
pub use ;
// The pure building blocks worth exposing for consumers + conformance tests (SPEC §9).
pub use ;
pub use ;
pub use ;
pub use ;
/// A binary's identity, passed to [`init`] and the [`logs`] verbs.
/// How the binary is running — stamped as the `run_context` field (SPEC §2).