#[cfg(feature = "log4rs")]
mod log4rs;
#[cfg(feature = "log4rs")]
pub use log4rs::*;
mod cat;
pub use cat::*;
#[macro_export]
macro_rules! trace {
() => {{}};
($($x:tt)*) => {{
#[cfg(debug_assertions)]
println!(
"\x1b[95m[ TRACE] - {}\x1b[0m",
format_args!($($x)*)
);
#[cfg(not(debug_assertions))]
log::trace!($($x)*);
}};
}
#[macro_export]
macro_rules! debug {
() => {{
println!();
}};
($($x:tt)*) => {{
#[cfg(debug_assertions)]
println!(
"\x1b[96m[ DEBUG] - {}\x1b[0m",
format_args!($($x)*)
);
#[cfg(not(debug_assertions))]
log::debug!($($x)*);
}};
}
#[macro_export]
macro_rules! info {
() => {{}};
($($x:tt)*) => {{
#[cfg(debug_assertions)]
println!(
"\x1b[32m[ INFO] - {}\x1b[0m",
format_args!($($x)*)
);
#[cfg(not(debug_assertions))]
log::info!($($x)*);
}};
}
#[macro_export]
macro_rules! warn {
() => {{}};
($($x:tt)*) => {{
#[cfg(debug_assertions)]
println!(
"\x1b[33m[ WARN] - {}\x1b[0m",
format_args!($($x)*)
);
#[cfg(not(debug_assertions))]
log::warn!($($x)*);
}};
}
#[macro_export]
macro_rules! error {
() => {{}};
($($x:tt)*) => {{
#[cfg(debug_assertions)]
println!(
"\x1b[31m[ ERROR] - {}\x1b[0m",
format_args!($($x)*)
);
#[cfg(not(debug_assertions))]
log::error!($($x)*);
}};
}