diff --git a/src/utils/cli_styles.rs b/src/utils/cli_styles.rs index 74c4a18..f63b38f 100644 --- a/src/utils/cli_styles.rs +++ b/src/utils/cli_styles.rs @@ -15,6 +15,10 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . +#[allow(unused_imports)] +pub use owo_colors::{OwoColorize as Colorize, Style}; + +// Сli theme styles #[allow(dead_code)] pub const RESET: &str = "\x1b[0m"; diff --git a/src/utils/log.rs b/src/utils/log.rs index a029d37..6554e41 100644 --- a/src/utils/log.rs +++ b/src/utils/log.rs @@ -42,3 +42,28 @@ pub fn init() { }) .init(); } + +/// Prints message to stdout with the given `Style`. Copy of println! macro +#[allow(unused_macros)] +macro_rules! sprintln { + ($style:expr, $($arg:tt)*) => { + { + use ::owo_colors::OwoColorize as _; + println!("{}", format!($($arg)*).style($style)); + } + }; +} + +/// Prints message to stdout with the given `Style`. Copy of print! macro +#[allow(unused_macros)] +macro_rules! sprint { + ($style:expr, $($arg:tt)*) => { + { + use ::owo_colors::OwoColorize as _; + print!("{}", format!($($arg)*).style($style)); + } + }; +} + +#[allow(unused_imports)] +pub(crate) use {sprint, sprintln};