use std::sync::atomic::{AtomicBool, Ordering};
use colored::Colorize;
use crate::palette;
static VERBOSE: AtomicBool = AtomicBool::new(false);
pub fn set_verbose(enabled: bool) {
VERBOSE.store(enabled, Ordering::SeqCst);
}
#[must_use]
pub fn is_verbose() -> bool {
VERBOSE.load(Ordering::SeqCst)
}
pub fn info(message: impl AsRef<str>) {
if is_verbose() {
let (r, g, b) = palette::DEEPSEEK_SKY_RGB;
eprintln!("{} {}", "info".truecolor(r, g, b).bold(), message.as_ref());
}
}
pub fn warn(message: impl AsRef<str>) {
if is_verbose() {
let (r, g, b) = palette::DEEPSEEK_SKY_RGB;
eprintln!("{} {}", "warn".truecolor(r, g, b).bold(), message.as_ref());
}
}