wlan_telemetry/util/
cobalt_logger.rs1#[allow(unused)]
9macro_rules! log_cobalt_1dot1 {
10 ($cobalt_proxy:expr, $method_name:ident, $metric_id:expr, $value:expr, $event_codes:expr $(,)?) => {{
11 let status = $cobalt_proxy.$method_name($metric_id, $value, $event_codes).await;
12 match status {
13 Ok(Ok(())) => (),
14 Ok(Err(e)) => log::info!("Failed logging metric: {}, error: {:?}", $metric_id, e),
15 Err(e) => log::info!("Failed logging metric: {}, error: {}", $metric_id, e),
16 }
17 }};
18}
19
20macro_rules! log_cobalt_1dot1_batch {
21 ($cobalt_proxy:expr, $events:expr, $context:expr $(,)?) => {{
22 let status = $cobalt_proxy.log_metric_events($events).await;
23 match status {
24 Ok(Ok(())) => (),
25 Ok(Err(e)) => {
26 log::info!("Failed logging batch metrics, context: {}, error: {:?}", $context, e);
27 }
28 Err(e) => {
29 log::info!("Failed logging batch metrics, context: {}, error: {}", $context, e)
30 }
31 }
32 }};
33}
34
35#[allow(unused)]
37pub(crate) use {log_cobalt_1dot1, log_cobalt_1dot1_batch};