use std::sync::atomic::{AtomicBool, Ordering}; mod colorize_wrapper; pub use colorize_wrapper::*; /// Global flag controlling whether ANSI color output is enabled. static ANSI_ENABLED: AtomicBool = AtomicBool::new(true); /// Enable ANSI color codes in output. pub fn enable_ansi() { ANSI_ENABLED.store(true, Ordering::Relaxed); } /// Disable ANSI color codes in output. pub fn disable_ansi() { ANSI_ENABLED.store(false, Ordering::Relaxed); } /// Set ANSI color output to the specified state (`true` to enable, `false` to disable). pub fn set_ansi(enabled: bool) { ANSI_ENABLED.store(enabled, Ordering::Relaxed); } /// Check whether ANSI color output is currently enabled. pub fn is_ansi_enabled() -> bool { ANSI_ENABLED.load(Ordering::Relaxed) } /// Returns `true` if ANSI is enabled, `false` otherwise. pub fn is_enabled() -> bool { is_ansi_enabled() }