clap_logflag/
config.rs

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

#[derive(Debug, Clone, PartialEq, Eq)]
pub enum LoggingConfig {
    LoggingDisabled,
    LoggingEnabled {
        destinations: Vec<LogDestinationConfig>,
    },
}

#[derive(Debug, Clone, PartialEq, Eq)]
pub enum LogDestination {
    Stderr,
    File(PathBuf),
    Syslog,
}

#[derive(Debug, Clone, PartialEq, Eq)]
pub struct LogDestinationConfig {
    pub destination: LogDestination,

    /// Only log messages at this level or higher to this destination.
    ///
    /// If `None`, the default level is used.
    pub level: Option<log::LevelFilter>,
}