#[cfg(feature = "debug_prints")]
pub use debug::enabled;
#[cfg(not(feature = "debug_prints"))]
macro_rules! debug_print {
($($arg:tt)*) => {{}};
}
#[cfg(feature = "debug_prints")]
#[macro_use]
#[allow(clippy::module_inception)]
mod debug {
use std::sync::OnceLock;
macro_rules! debug_print {
($($arg:tt)*) => {{
if $crate::debug::enabled() {
eprintln!($($arg)*)
}
}};
}
pub fn enabled() -> bool {
static ENABLED: OnceLock<bool> = OnceLock::new();
*ENABLED.get_or_init(|| std::env::var("SAPHYR_DEBUG").is_ok())
}
}