log_rs/logger/
enums.rs

1use std::fmt;
2
3/// Identify the three kinds of output supported.
4#[derive(Clone, Eq, PartialEq, Hash)]
5pub enum OutputKind<'f> {
6    STDOUT,
7    STDERR,
8    FILE(&'f str),
9}
10
11/// Identify the level of the log.
12#[derive(Eq, PartialEq, Hash)]
13pub enum Level {
14    INFO,
15    DEBUG,
16    WARNING,
17    ERROR,
18}
19
20impl fmt::Display for Level {
21    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
22        match self {
23            Level::INFO => write!(f, "INFO"),
24            Level::DEBUG => write!(f, "DEBUG"),
25            Level::WARNING => write!(f, "WARNING"),
26            Level::ERROR => write!(f, "ERROR"),
27        }
28    }
29}