macro_rules! log_item {
($label:expr, $description:expr, $function:expr) => { ... };
}
Expand description
Creates a LogItem
struct that is annotated with the source file and line
number where the log condition was discovered.
Takes three parameters, each of which may be a &'static str
or String
:
label
: name of object this LogItem references (typically a JUMBF path reference)description
: human-readable reason for thisLogItem
to have been generatedfunction
: name of the function generating thisLogItem
ยงExample
let log = log_item!("test1", "test item 1", "test func");
assert_eq!(
log,
LogItem {
kind: LogKind::Informational,
label: Cow::Borrowed("test1"),
crate_name: Cow::Borrowed(env!("CARGO_PKG_NAME")),
crate_version: Cow::Borrowed(env!("CARGO_PKG_VERSION")),
description: Cow::Borrowed("test item 1"),
file: Cow::Borrowed(file!()),
function: Cow::Borrowed("test func"),
line: log.line,
..Default::default()
}
);