macro_rules! error {
(logger: $logger:expr, $($arg:tt)+) => { ... };
($($arg:tt)+) => { ... };
}
Expand description
Logs a message at the error level.
§Named optional parameters
Name | Type | Description |
---|---|---|
logger | Arc<Logger> or Logger | If specified, the given logger will be used instead of the global default logger. |
§Examples
use spdlog::error;
let (err_info, port) = ("No connection", 22);
// Using the global default logger
error!("Error: {} on port {}", err_info, port);
// Or using the specified logger
error!(logger: app_events, "App Error: {}, Port: {}", err_info, port);