#[macro_export]
macro_rules! debug_log {
($($arg:tt)*) => {
#[cfg(feature = "tracing")]
tracing::debug!($($arg)*);
};
}
#[macro_export]
macro_rules! log_cache_hit {
($($arg:tt)*) => {
#[cfg(all(feature = "tracing", not(feature = "plain-logs")))]
tracing::debug!("📊 [CACHE-HIT] {}", format!($($arg)*));
#[cfg(all(feature = "tracing", feature = "plain-logs"))]
tracing::debug!("[CACHE-HIT] {}", format!($($arg)*));
};
}
#[macro_export]
macro_rules! log_cache_store {
($($arg:tt)*) => {
#[cfg(all(feature = "tracing", not(feature = "plain-logs")))]
tracing::debug!("📊 [CACHE-STORE] {}", format!($($arg)*));
#[cfg(all(feature = "tracing", feature = "plain-logs"))]
tracing::debug!("[CACHE-STORE] {}", format!($($arg)*));
};
}
#[macro_export]
macro_rules! log_cache_invalidate {
($($arg:tt)*) => {
#[cfg(all(feature = "tracing", not(feature = "plain-logs")))]
tracing::debug!("🗑️ [CACHE-INVALIDATE] {}", format!($($arg)*));
#[cfg(all(feature = "tracing", feature = "plain-logs"))]
tracing::debug!("[CACHE-INVALIDATE] {}", format!($($arg)*));
};
}
#[macro_export]
macro_rules! log_mutation_start {
($($arg:tt)*) => {
#[cfg(all(feature = "tracing", not(feature = "plain-logs")))]
tracing::debug!("🔄 [MUTATION] {}", format!($($arg)*));
#[cfg(all(feature = "tracing", feature = "plain-logs"))]
tracing::debug!("[MUTATION] {}", format!($($arg)*));
};
}
#[macro_export]
macro_rules! log_mutation_success {
($($arg:tt)*) => {
#[cfg(all(feature = "tracing", not(feature = "plain-logs")))]
tracing::debug!("✅ [MUTATION] {}", format!($($arg)*));
#[cfg(all(feature = "tracing", feature = "plain-logs"))]
tracing::debug!("[MUTATION-SUCCESS] {}", format!($($arg)*));
};
}
#[macro_export]
macro_rules! log_mutation_error {
($($arg:tt)*) => {
#[cfg(all(feature = "tracing", not(feature = "plain-logs")))]
tracing::debug!("❌ [MUTATION] {}", format!($($arg)*));
#[cfg(all(feature = "tracing", feature = "plain-logs"))]
tracing::debug!("[MUTATION-ERROR] {}", format!($($arg)*));
};
}
#[macro_export]
macro_rules! log_optimistic {
($($arg:tt)*) => {
#[cfg(all(feature = "tracing", not(feature = "plain-logs")))]
tracing::debug!("⚡ [OPTIMISTIC] {}", format!($($arg)*));
#[cfg(all(feature = "tracing", feature = "plain-logs"))]
tracing::debug!("[OPTIMISTIC] {}", format!($($arg)*));
};
}
#[macro_export]
macro_rules! log_rollback {
($($arg:tt)*) => {
#[cfg(all(feature = "tracing", not(feature = "plain-logs")))]
tracing::debug!("🔄 [ROLLBACK] {}", format!($($arg)*));
#[cfg(all(feature = "tracing", feature = "plain-logs"))]
tracing::debug!("[ROLLBACK] {}", format!($($arg)*));
};
}