macro_rules! warn {
($($fmt:expr),+) => { ... };
}
Expand description
This macro generates a warning message.
It formats and prints a warning when the global log level is set to 2 or higher.
It leverages a thread-local storage for indentation to structure the output appropriately, highlighting the word “WARN” and the formatted message with ANSI escape codes to apply color and style.
The macro uses eprintln!
to output the warning to the standard error stream, including the file name and line number where the macro is invoked, enhancing debugging and log tracing capabilities.