summaryrefslogtreecommitdiff
path: root/src/debug.rs
blob: 2f7da4ec6f646839211d1cbbc0281d3486341734 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
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)*));
    };
}