macro_rules! debgb {
($fmt:literal, $e:expr) => { ... };
}
Expand description
Expands into a conditional logging block for debugging expressions.
It evaluates whether the log level is sufficiently high (4 or above) to output detailed debug information. If the condition is met, it inserts an entry into the log with a specific format that highlights the debug message and includes the file and line number where the macro is used. The macro adjusts the indentation context before and after the expression is evaluated to maintain a coherent log structure. Regardless of the log level, the expression is always executed, and its result is returned. This macro is useful for temporarily inserting detailed logging around specific sections of code, especially during development and debugging sessions.