macro_rules! debug_error {
($($arg:tt)*) => { ... };
}Expand description
Creates a DebugError without automatic logging
Use this macro when you want the location tracking benefits of DebugError but prefer to handle logging yourself or don’t want automatic logging.
§When to Use
- Production code where you control logging
- When you want to add custom context before logging
- When using custom error handling middleware
- When you have proper error handling infrastructure set up
§Examples
use debug_error::{debug_error, DebugError};
use log::warn;
fn validate_input(input: &str) -> Result<(), DebugError> {
if input.is_empty() {
let err = debug_error!("Input cannot be empty");
warn!("Validation warning: {}", err);
return Err(err);
}
Ok(())
}