use libcros::{LOG, LOG_DBG, LOG_FATAL, LOG_FATAL_NOEXIT, Logger, libargs::ArgCheck};
fn main() {
let mut args: ArgCheck = ArgCheck::new();
let verbose: bool = args.fbool("--verbose", "", "Enable debug messages");
let use_colors: bool = args.fbool("--colors", "-c", "Use colors when logging");
let rc = args.fequals_str("--rc", "-r", "Exit code for fatal errors");
args.check_help();
let parsed_rc: i32 = if rc.is_empty() {
-1
} else {
rc.parse().unwrap_or(-1)
};
Logger::init(verbose, use_colors);
LOG!("This is an regular log");
LOG_DBG!("This is a verbose log");
LOG_FATAL_NOEXIT!("This is a fatal log but will not automatically exit the program.");
LOG_FATAL!(parsed_rc;
"This is a fatal log and will automatically exit the program."
);
}