Skip to main content

running_phase_indent

Function running_phase_indent 

Source
pub fn running_phase_indent() -> String
Expand description

Indent prefix (single-space repeats) for log lines whose visual nesting should match the executing phase’s scope depth. Empty string when no scene tree is installed.

One char per level — deep scenario trees can stack 5+ levels of nesting; a 2-char indent burns 10+ columns of screen real estate before any content lands.

Used by emit sites that fire from inside a phase’s execution (polling-op progress, activity-end DONE summary, relevancy stats, the errorhandler / metrics-diag log bridges) so they nest under the phase’s startup line in tui=terminal output.

SRD-100 P1c — the depth comes from the ambient executing phase (crate::execution_context::current_phase_node, a task-local set by run_phase and carried across fiber spawns by propagate), so under concurrency each phase’s emit nests under ITS OWN depth. The historical “first Running in DFS order” guess — which mis-indented a poll line to a concurrent sibling — remains only as the fallback for emitters with no phase task-local (the metrics scheduler thread and other genuinely cross-phase sinks, where “which phase” is undefined).