grafeo_common/
tracing_macros.rs1pub struct NoopSpan;
12
13#[macro_export]
15macro_rules! grafeo_info_span {
16 ($($arg:tt)*) => {{
17 #[cfg(feature = "tracing")]
18 { ::tracing::info_span!($($arg)*).entered() }
19 #[cfg(not(feature = "tracing"))]
20 { $crate::tracing_macros::NoopSpan }
21 }};
22}
23
24#[macro_export]
26macro_rules! grafeo_debug_span {
27 ($($arg:tt)*) => {{
28 #[cfg(feature = "tracing")]
29 { ::tracing::debug_span!($($arg)*).entered() }
30 #[cfg(not(feature = "tracing"))]
31 { $crate::tracing_macros::NoopSpan }
32 }};
33}
34
35#[macro_export]
42macro_rules! grafeo_warn {
43 ($($arg:tt)*) => {{
44 #[cfg(feature = "tracing")]
45 { ::tracing::warn!($($arg)*); }
46 #[cfg(not(feature = "tracing"))]
47 { if false { let _ = format_args!($($arg)*); } }
48 }};
49}
50
51#[macro_export]
53macro_rules! grafeo_info {
54 ($($arg:tt)*) => {{
55 #[cfg(feature = "tracing")]
56 { ::tracing::info!($($arg)*); }
57 #[cfg(not(feature = "tracing"))]
58 { if false { let _ = format_args!($($arg)*); } }
59 }};
60}
61
62#[macro_export]
64macro_rules! grafeo_debug {
65 ($($arg:tt)*) => {{
66 #[cfg(feature = "tracing")]
67 { ::tracing::debug!($($arg)*); }
68 #[cfg(not(feature = "tracing"))]
69 { if false { let _ = format_args!($($arg)*); } }
70 }};
71}
72
73#[macro_export]
75macro_rules! grafeo_error {
76 ($($arg:tt)*) => {{
77 #[cfg(feature = "tracing")]
78 { ::tracing::error!($($arg)*); }
79 #[cfg(not(feature = "tracing"))]
80 { if false { let _ = format_args!($($arg)*); } }
81 }};
82}