You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
42 lines
801 B
Rust
42 lines
801 B
Rust
use crate::IglooStatus::{self, *};
|
|
use crate::IglooType::{self, *};
|
|
use crate::IglooDebugSeverity::{self, *};
|
|
pub static TRACE_LEVEL: IglooDebugSeverity = TRACE;
|
|
|
|
macro_rules! igloo_debug
|
|
{
|
|
($severity:expr, $status:expr) =>
|
|
{
|
|
if cfg!(debug_assertions)
|
|
{
|
|
if $severity as u8 <= TRACE_LEVEL.clone() as u8
|
|
{
|
|
println!("[{:?}]: Line {:?} in {:?} | {:?}",
|
|
$severity,
|
|
line!(),
|
|
file!(),
|
|
$status);
|
|
}
|
|
}
|
|
};
|
|
|
|
($severity:expr, $status:expr, $($message:tt)*) =>
|
|
{
|
|
if cfg!(debug_assertions)
|
|
{
|
|
if $severity as u8 <= TRACE_LEVEL.clone() as u8
|
|
{
|
|
println!("[{:?}]: Line {:?} in {} | {} -- STATUS: {:?}",
|
|
$severity,
|
|
line!(),
|
|
file!(),
|
|
format_args!($($message)*),
|
|
$status
|
|
);
|
|
}
|
|
}
|
|
};
|
|
}
|
|
|
|
pub(crate) use igloo_debug;
|