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
use std::fmt;

/// Identify the three kinds of output supported.
#[derive(Clone, Eq, PartialEq, Hash)]
pub enum OutputKind<'f> {
    STDOUT,
    STDERR,
    FILE(&'f str),
}

/// Identify the level of the log.
#[derive(Eq, PartialEq, Hash)]
pub enum Level {
    INFO,
    DEBUG,
    WARNING,
    ERROR,
}

impl fmt::Display for Level {
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        match self {
            Level::INFO => write!(f, "INFO"),
            Level::DEBUG => write!(f, "DEBUG"),
            Level::WARNING => write!(f, "WARNING"),
            Level::ERROR => write!(f, "ERROR"),
        }
    }
}