dioxus_provider/
log_utils.rs1#[macro_export]
22macro_rules! debug_log {
23 ($($arg:tt)*) => {
24 #[cfg(feature = "tracing")]
25 tracing::debug!($($arg)*);
26 };
27}
28
29#[macro_export]
31macro_rules! log_cache_hit {
32 ($($arg:tt)*) => {
33 #[cfg(all(feature = "tracing", not(feature = "plain-logs")))]
34 tracing::debug!("📊 [CACHE-HIT] {}", format!($($arg)*));
35 #[cfg(all(feature = "tracing", feature = "plain-logs"))]
36 tracing::debug!("[CACHE-HIT] {}", format!($($arg)*));
37 };
38}
39
40#[macro_export]
42macro_rules! log_cache_store {
43 ($($arg:tt)*) => {
44 #[cfg(all(feature = "tracing", not(feature = "plain-logs")))]
45 tracing::debug!("📊 [CACHE-STORE] {}", format!($($arg)*));
46 #[cfg(all(feature = "tracing", feature = "plain-logs"))]
47 tracing::debug!("[CACHE-STORE] {}", format!($($arg)*));
48 };
49}
50
51#[macro_export]
53macro_rules! log_cache_invalidate {
54 ($($arg:tt)*) => {
55 #[cfg(all(feature = "tracing", not(feature = "plain-logs")))]
56 tracing::debug!("🗑️ [CACHE-INVALIDATE] {}", format!($($arg)*));
57 #[cfg(all(feature = "tracing", feature = "plain-logs"))]
58 tracing::debug!("[CACHE-INVALIDATE] {}", format!($($arg)*));
59 };
60}
61
62#[macro_export]
64macro_rules! log_mutation_start {
65 ($($arg:tt)*) => {
66 #[cfg(all(feature = "tracing", not(feature = "plain-logs")))]
67 tracing::debug!("🔄 [MUTATION] {}", format!($($arg)*));
68 #[cfg(all(feature = "tracing", feature = "plain-logs"))]
69 tracing::debug!("[MUTATION] {}", format!($($arg)*));
70 };
71}
72
73#[macro_export]
75macro_rules! log_mutation_success {
76 ($($arg:tt)*) => {
77 #[cfg(all(feature = "tracing", not(feature = "plain-logs")))]
78 tracing::debug!("✅ [MUTATION] {}", format!($($arg)*));
79 #[cfg(all(feature = "tracing", feature = "plain-logs"))]
80 tracing::debug!("[MUTATION-SUCCESS] {}", format!($($arg)*));
81 };
82}
83
84#[macro_export]
86macro_rules! log_mutation_error {
87 ($($arg:tt)*) => {
88 #[cfg(all(feature = "tracing", not(feature = "plain-logs")))]
89 tracing::debug!("❌ [MUTATION] {}", format!($($arg)*));
90 #[cfg(all(feature = "tracing", feature = "plain-logs"))]
91 tracing::debug!("[MUTATION-ERROR] {}", format!($($arg)*));
92 };
93}
94
95#[macro_export]
97macro_rules! log_optimistic {
98 ($($arg:tt)*) => {
99 #[cfg(all(feature = "tracing", not(feature = "plain-logs")))]
100 tracing::debug!("⚡ [OPTIMISTIC] {}", format!($($arg)*));
101 #[cfg(all(feature = "tracing", feature = "plain-logs"))]
102 tracing::debug!("[OPTIMISTIC] {}", format!($($arg)*));
103 };
104}
105
106#[macro_export]
108macro_rules! log_rollback {
109 ($($arg:tt)*) => {
110 #[cfg(all(feature = "tracing", not(feature = "plain-logs")))]
111 tracing::debug!("🔄 [ROLLBACK] {}", format!($($arg)*));
112 #[cfg(all(feature = "tracing", feature = "plain-logs"))]
113 tracing::debug!("[ROLLBACK] {}", format!($($arg)*));
114 };
115}