2020-02-21 02:11:53 +07:00
|
|
|
macro_rules! warn {
|
|
|
|
($fmt:literal, $ex:expr) => {{
|
|
|
|
use console::{style, Emoji};
|
2021-04-18 20:40:47 +07:00
|
|
|
use std::env;
|
2020-02-21 02:11:53 +07:00
|
|
|
let formatstr = format!($fmt, $ex);
|
2021-03-21 01:52:57 +07:00
|
|
|
if env::var("NO_EMOJI").is_ok() {
|
2021-04-18 20:40:47 +07:00
|
|
|
println!("{} {}", style("!").red(), style(formatstr).red());
|
2021-03-21 01:52:57 +07:00
|
|
|
} else {
|
|
|
|
println!(
|
|
|
|
"{} {}",
|
|
|
|
style(Emoji("⚠️ ", "!")).red(),
|
|
|
|
style(formatstr).red()
|
|
|
|
);
|
2021-03-19 16:16:07 +07:00
|
|
|
}
|
2020-02-21 02:11:53 +07:00
|
|
|
}};
|
|
|
|
}
|
|
|
|
|
|
|
|
macro_rules! success {
|
|
|
|
($fmt:literal, $ex:expr) => {{
|
|
|
|
use console::{style, Emoji};
|
2021-04-18 20:40:47 +07:00
|
|
|
use std::env;
|
2020-02-21 02:11:53 +07:00
|
|
|
let formatstr = format!($fmt, $ex);
|
2021-03-21 01:52:57 +07:00
|
|
|
if env::var("NO_EMOJI").is_ok() {
|
2021-04-18 20:40:47 +07:00
|
|
|
println!("{} {}", style("✓").green(), style(formatstr).green());
|
2021-03-21 01:52:57 +07:00
|
|
|
} else {
|
|
|
|
println!(
|
|
|
|
"{} {}",
|
|
|
|
style(Emoji("✅", "✓")).green(),
|
|
|
|
style(formatstr).green()
|
|
|
|
);
|
2021-03-19 16:16:07 +07:00
|
|
|
}
|
2020-02-21 02:11:53 +07:00
|
|
|
}};
|
|
|
|
}
|