flatland_client_lib/
harvest_debug.rs1pub const TARGET: &str = "flatland.harvest";
7
8pub fn verbose() -> bool {
9 static ON: std::sync::OnceLock<bool> = std::sync::OnceLock::new();
10 *ON.get_or_init(|| {
11 std::env::var("FLATLAND_DEBUG_HARVEST")
12 .map(|v| v == "1" || v.eq_ignore_ascii_case("true"))
13 .unwrap_or(false)
14 })
15}
16
17#[macro_export]
19macro_rules! harvest_trace {
20 ($($arg:tt)*) => {
21 if $crate::harvest_debug::verbose() {
22 tracing::info!(target: $crate::harvest_debug::TARGET, $($arg)*);
23 } else {
24 tracing::debug!(target: $crate::harvest_debug::TARGET, $($arg)*);
25 }
26 };
27}