pub const YELLOW: &str = "\x1b[33m";
pub const GREEN: &str = "\x1b[32m";
pub const RED: &str = "\x1b[31m";
pub const RESET: &str = "\x1b[0m";
#[macro_export]
macro_rules! yellow {
($text:expr) => {
concat!("\x1b[33m", $text, "\x1b[0m")
};
}
#[macro_export]
macro_rules! green {
($text:expr) => {
concat!("\x1b[32m", $text, "\x1b[0m")
};
}
#[macro_export]
macro_rules! debug_log {
($debug:expr, $($arg:tt)*) => {
if $debug { eprintln!("{}[DEBUG]{} {}", $crate::common::color::YELLOW, $crate::common::color::RESET, format!($($arg)*)); }
};
}
#[macro_export]
macro_rules! info_log {
($($arg:tt)*) => {
eprintln!("{}[INFO]{} {}", $crate::common::color::GREEN, $crate::common::color::RESET, format!($($arg)*));
};
}
#[macro_export]
macro_rules! warning_log {
($($arg:tt)*) => {
eprintln!("{}[WARNING]{} {}", $crate::common::color::YELLOW, $crate::common::color::RESET, format!($($arg)*));
};
}
#[macro_export]
macro_rules! error_log {
($($arg:tt)*) => {
eprintln!("{}[ERROR]{} {}", $crate::common::color::RED, $crate::common::color::RESET, format!($($arg)*));
};
}