summaryrefslogtreecommitdiff
path: root/src/debug.rs
diff options
context:
space:
mode:
authorrorka900 <rorka900@gmail.com>2026-03-19 11:44:27 +0000
committerrorka900 <rorka900@gmail.com>2026-03-19 11:44:27 +0000
commit693f5143adb352b9fa1ee262b3537f6e429678f9 (patch)
treeb8c9bc10fc0901bcbfd3c1d5990b70d601a08828 /src/debug.rs
downloadror-master.tar.gz
ror-master.zip
Initial commitmaster
Diffstat (limited to 'src/debug.rs')
-rw-r--r--src/debug.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/debug.rs b/src/debug.rs
new file mode 100644
index 0000000..2f7da4e
--- /dev/null
+++ b/src/debug.rs
@@ -0,0 +1,14 @@
+use std::env;
+
+pub fn debug(msg: &str) {
+ if env::var("ROR_DEBUG").unwrap_or_default() == "1" {
+ eprintln!("[DEBUG] {}", msg);
+ }
+}
+
+#[macro_export]
+macro_rules! debug {
+ ($($arg:tt)*) => {
+ $crate::debug::debug(&format!($($arg)*));
+ };
+}