1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
use std::{fmt::Display, process};

use lazy_static::lazy_static;

lazy_static! {
  static ref INFO: String = String::from_utf8_lossy(&[
    27, 91, 51, 52, 109, 27, 91, 49, 109, 73, 78, 70, 79, 58, 32, 27, 91, 109,
  ])
  .to_string();
  static ref WARN: String = String::from_utf8_lossy(&[
    27, 91, 51, 51, 109, 27, 91, 49, 109, 87, 65, 82, 78, 58, 32, 27, 91, 109,
  ])
  .to_string();
  static ref ERROR: String = String::from_utf8_lossy(&[
    27, 91, 51, 49, 109, 27, 91, 49, 109, 69, 82, 82, 58, 32, 27, 91, 109,
  ])
  .to_string();
}

pub fn info<T: Display>(msg: T) {
  println!("{}{msg}", *INFO);
}

pub fn warn<T: Display>(msg: T) {
  println!("{}{msg}", *WARN);
}

pub fn error<T: Display>(msg: T) -> ! {
  println!("{}{msg}", *ERROR);
  process::exit(1);
}