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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
//! Process-global section nesting depth and the RAII guards that move it.
use PENDING;
use OnceLock;
use ;
/// Process-global section nesting depth. Drives the 2-space-per-level
/// indentation applied to every stderr log line so output produced
/// inside a [`StageLogger::group`](crate::log::StageLogger::group) sits visually beneath its header.
///
/// A single atomic (rather than per-logger state) is correct because the
/// release pipeline drives one stderr stream and no `group()` is ever
/// opened from a worker thread — sections bracket whole stages on the
/// main thread, while a stage's interior parallelism (e.g. `build`
/// spawning per-target threads) emits *inside* an already-open section.
/// The depth is therefore a property of "where the main thread is in the
/// run", not of any individual logger clone or worker.
pub static SECTION_DEPTH: AtomicUsize = new;
/// Env var carrying a parent `anodizer` process's visual nesting depth.
///
/// The determinism harness spawns child `anodizer release` subprocesses
/// whose stderr is inherited, so the child's lines interleave directly
/// into the parent's stream. Without an inherited base depth the child's
/// section headers would render flush-left, visually escaping the
/// parent's open section. The parent exports its depth here; the child
/// reads it once (see `base_depth`) and offsets every indent by it.
pub const LOG_DEPTH_ENV: &str = "ANODIZER_LOG_DEPTH";
/// Base nesting depth inherited from a parent process via
/// [`LOG_DEPTH_ENV`], parsed once on first use. Zero when the var is
/// absent or unparseable (a standalone process indents from column 0).
pub static BASE_DEPTH: = new;
/// Parse the inherited base depth from a raw [`LOG_DEPTH_ENV`] value.
/// Lenient by design: a missing or malformed value degrades to 0 (the
/// standalone-process default) rather than failing — indentation is
/// presentation, never worth aborting a release over.
pub
/// The process's inherited base depth (see [`LOG_DEPTH_ENV`]).
pub
/// Current absolute nesting depth: the inherited base plus every open
/// section. This is the value [`indent`](crate::log::indent) renders and the value a parent
/// exports (offset for the child's nesting) when spawning a subprocess
/// whose stderr joins this process's stream.
/// RAII guard returned by [`indent_one_level`]. Removes the extra indent
/// level when dropped.
/// Deepen the body indent by one level WITHOUT opening a section header.
///
/// For rows that must align with the body bullets of sibling sections
/// while no section is open — e.g. the pipeline's consolidated
/// `skipped a, b, c` row, which prints between stage sections (the
/// previous stage's guard has already dropped) but should sit at the
/// same column as those sections' own `•` lines instead of two columns
/// to their left. Unlike [`StageLogger::group`](crate::log::StageLogger::group) this pushes no pending
/// header, so nothing extra ever prints.
/// RAII guard returned by [`StageLogger::group`](crate::log::StageLogger::group). Closes the section
/// (decrements the indent depth) when dropped, so a stage's body
/// indentation is always balanced even if the stage bails early with `?`.