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

#[macro_use]
extern crate lazy_static;
extern crate backtrace;

#[macro_use]
mod macros;
pub mod parsed_backtrace;
pub mod formatter;

use std::sync::RwLock;
pub use backtrace::Backtrace;
pub use formatter::Formatter;

/* Possible symbols -> : | ❯ */
lazy_static! {
    pub static ref PRINTER: RwLock<Formatter> = {
        RwLock::new(
            Formatter {
                sep: String::from(":"),
                arrow: String::from(" ❯ "),
                eq: String::from(" = "),
            }
        )
    };
}

pub fn set_separator_symbol(symbol: &str) {
    PRINTER.write().unwrap().sep = String::from(symbol);
}

pub fn set_arrow_symbol(symbol: &str) {
    PRINTER.write().unwrap().arrow = String::from(symbol);
}

pub fn set_equals_symbol(symbol: &str) {
    PRINTER.write().unwrap().eq = String::from(symbol);
}