use log::LevelFilter;
#[derive(Clone, Copy, Debug)]
pub struct Settings {
max_level: LevelFilter,
enable_metrics: bool,
style: Style,
}
impl Settings {
pub fn new(max_level: LevelFilter) -> Self {
Settings {
max_level,
enable_metrics: false,
style: Style::Structured,
}
}
pub fn with_metrics_enabled(mut self, value: bool) -> Self {
self.enable_metrics = value;
self
}
pub fn with_style(mut self, value: Style) -> Self {
self.style = value;
self
}
pub(crate) fn max_level(&self) -> LevelFilter {
self.max_level
}
pub(crate) fn enable_metrics(&self) -> bool {
self.enable_metrics
}
pub(crate) fn style(&self) -> Style {
self.style
}
}
#[derive(Clone, Copy, Debug)]
pub enum Style {
Structured,
HumanReadable,
}