Mountain/Binary/Debug/
TraceLog.rs

1//! # TraceLog
2//!
3//! Provides debug tracing macro for fine-grained execution step tracking.
4//!
5//! ## RESPONSIBILITIES
6//!
7//! ### Macro Definition
8//! - Define TraceStep macro for trace-level logging
9//! - Provide low-intrusion debug checkpoint logging
10//! - Support formatted trace messages for step-by-step execution
11//!
12//! ## ARCHITECTURAL ROLE
13//!
14//! ### Position in Mountain
15//! - Debug infrastructure module in Binary subsystem
16//! - Cross-cutting concern available throughout the application
17//!
18//! ### Dependencies
19//! - log: Logging framework
20//! - trace: Trace level log filter
21//!
22//! ### Dependents
23//! - All Binary subsystem modules for execution tracking
24//! - Fn() main entry point for startup sequence logging
25//!
26//! ## SECURITY
27//!
28//! ### Considerations
29//! - Macro expands to trace-level logs, does not modify runtime behavior
30//! - No security impact, purely diagnostic
31//!
32//! ## PERFORMANCE
33//!
34//! ### Considerations
35//! - Logs at TRACE level, filtered out in production builds
36//! - Zero runtime cost when RUST_LOG does not include TRACE level
37//! - Minimal code generation overhead from macro expansion
38
39use log::trace;
40
41/// Logs a checkpoint message at TRACE level (for "every step" tracing).
42///
43/// This macro provides a low-intrusion way to trace execution flow through
44/// the application startup and shutdown sequences. It expands to a single
45/// trace!() call which incurs zero overhead when TRACE logging is disabled.
46///
47/// # Example
48///
49/// ```rust,ignore
50/// TraceStep!("[Boot] [Runtime] Building Tokio runtime...");
51/// TraceStep!("[Boot] [Setup] Configuration loaded: {}", ConfigPath);
52/// ```
53///
54/// The macro accepts the same format arguments as the standard log!() macro:
55/// - A literal format string
56/// - Optional comma-separated values for format placeholders
57#[macro_export]
58macro_rules! TraceStep {
59	($($arg:tt)*) => {{
60		trace!($($arg)*);
61	}};
62}