Macro error

Source
macro_rules! error {
    (logger: $logger:expr, $($arg:tt)+) => { ... };
    ($($arg:tt)+) => { ... };
}
Expand description

Logs a message at the error level.

§Named optional parameters

NameTypeDescription
loggerArc<Logger> or LoggerIf 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);