diff options
Diffstat (limited to 'src/lib.rs')
-rw-r--r-- | src/lib.rs | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -70,6 +70,22 @@ pub fn get_log_level() -> LogLevel { $crate::NORMAL, ); } + }}; +} + +#[macro_export] macro_rules! fatal { + ($($tokens:tt)*) => {{ + if *$crate::LOG_LEVEL.lock().unwrap() <= { $crate::LogLevel::Fatal } { + eprint!("{}{}[FATAL]{}: ", + $crate::BOLD, + $crate::RED, + $crate::WHITE, + ); + eprint!($($tokens)*); + eprintln!("{}", + $crate::NORMAL, + ); + } std::process::exit(1); }}; } |