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
32
33
34
35
36
37
38
39
use log::{log, Level};
use paris::formatter::colorize_string;

fn level_to_color(level: Level) -> &'static str {
    match level {
        Level::Info => "blue",
        Level::Warn => "yellow",
        Level::Error => "red",
        _ => "white",
    }
}

/// A BIG log that's very difficult to miss.
pub fn basti_log(level: Level, message: &str) {
    let color = level_to_color(level);
    log!(
        level,
        "{}",
        colorize_string(format!(
            "<bold><{}>{}\n\n",
            &color,
            "-".repeat(message.len())
        ))
    );
    log!(
        level,
        "{}",
        colorize_string(format!("<bold><{}>{}\n\n", &color, message))
    );
    log!(
        level,
        "{}",
        colorize_string(format!(
            "<bold><{}>{}\n\n",
            &color,
            "-".repeat(message.len())
        ))
    );
}