wlan_telemetry/util/
cobalt_logger.rs#[allow(unused)]
macro_rules! log_cobalt_1dot1 {
($cobalt_proxy:expr, $method_name:ident, $metric_id:expr, $value:expr, $event_codes:expr $(,)?) => {{
let status = $cobalt_proxy.$method_name($metric_id, $value, $event_codes).await;
match status {
Ok(Ok(())) => (),
Ok(Err(e)) => tracing::info!("Failed logging metric: {}, error: {:?}", $metric_id, e),
Err(e) => tracing::info!("Failed logging metric: {}, error: {}", $metric_id, e),
}
}};
}
macro_rules! log_cobalt_1dot1_batch {
($cobalt_proxy:expr, $events:expr, $context:expr $(,)?) => {{
let status = $cobalt_proxy.log_metric_events($events).await;
match status {
Ok(Ok(())) => (),
Ok(Err(e)) => {
tracing::info!(
"Failed logging batch metrics, context: {}, error: {:?}",
$context,
e
);
}
Err(e) => {
tracing::info!("Failed logging batch metrics, context: {}, error: {}", $context, e)
}
}
}};
}
#[allow(unused)]
pub(crate) use {log_cobalt_1dot1, log_cobalt_1dot1_batch};