report_error

Macro report_error 

Source
macro_rules! report_error {
    ($error:expr, $($args:tt)*) => { ... };
}
Expand description

Create a tracing error event, casting the error to &dyn std::error::Error for [layer::ErrorLayer], and adding the type name as error.kind.

Usage:

use prima_tracing::report_error;

let error = "not a number".parse::<usize>().unwrap_err();
report_error!(error, "Parsing error!");

You can also add use add attributes and do things, just like with a regular tracing::error macro call

use prima_tracing::report_error;

let error = input.parse::<usize>().unwrap_err();
report_error!(error, input, user=uid, "Parsing error: {}", error);