pub const TARGET: &str = "flatland.harvest";
pub fn verbose() -> bool {
static ON: std::sync::OnceLock<bool> = std::sync::OnceLock::new();
*ON.get_or_init(|| {
std::env::var("FLATLAND_DEBUG_HARVEST")
.map(|v| v == "1" || v.eq_ignore_ascii_case("true"))
.unwrap_or(false)
})
}
#[macro_export]
macro_rules! harvest_trace {
($($arg:tt)*) => {
if $crate::harvest_debug::verbose() {
tracing::info!(target: $crate::harvest_debug::TARGET, $($arg)*);
} else {
tracing::debug!(target: $crate::harvest_debug::TARGET, $($arg)*);
}
};
}