#[cfg(feature = "tracing")]
#[macro_export]
macro_rules! tracked_error {
($($arg:tt)+) => {{
let location = std::panic::Location::caller();
::tracing::error!(diskann.file = location.file(), diskann.line = location.line(), $($arg)+);
}};
}
#[cfg(not(feature = "tracing"))]
#[macro_export]
macro_rules! tracked_error {
($($arg:tt)+) => {{
$crate::used!($($arg)+);
}};
}
#[cfg(feature = "tracing")]
#[macro_export]
macro_rules! tracked_warn {
($($arg:tt)+) => {{
let location = std::panic::Location::caller();
::tracing::warn!(diskann.file = location.file(), diskann.line = location.line(), $($arg)+);
}};
}
#[cfg(not(feature = "tracing"))]
#[macro_export]
macro_rules! tracked_warn {
($($arg:tt)+) => {{
$crate::used!($($arg)+);
}};
}
#[cfg(feature = "tracing")]
#[macro_export]
macro_rules! tracked_debug {
($($arg:tt)+) => {{
let location = std::panic::Location::caller();
::tracing::debug!(diskann.file = location.file(), diskann.line = location.line(), $($arg)+);
}};
}
#[cfg(not(feature = "tracing"))]
#[macro_export]
macro_rules! tracked_debug {
($($arg:tt)+) => {{
$crate::used!($($arg)+);
}};
}
#[cfg(feature = "tracing")]
#[macro_export]
macro_rules! tracked_trace {
($($arg:tt)+) => {{
let location = std::panic::Location::caller();
::tracing::trace!(diskann.file = location.file(), diskann.line = location.line(), $($arg)+);
}};
}
#[cfg(not(feature = "tracing"))]
#[macro_export]
macro_rules! tracked_trace {
($($arg:tt)+) => {{
$crate::used!($($arg)+);
}};
}
#[macro_export]
#[doc(hidden)]
macro_rules! used {
($($arg:tt)+) => {{
let _ = format_args!($($arg)+);
}}
}