use std::path::PathBuf;
use reovim_kernel::api::v1::Level;
#[derive(Debug, Clone)]
pub struct LogConfig {
pub level: Level,
pub output: LogOutput,
pub format: LogFormat,
pub file_path: Option<PathBuf>,
pub rotation: RotationPolicy,
}
impl Default for LogConfig {
fn default() -> Self {
Self {
level: Level::Info,
output: LogOutput::Stderr,
format: LogFormat::Plain,
file_path: None,
rotation: RotationPolicy::Never,
}
}
}
#[derive(Debug, Clone, Default)]
pub enum LogOutput {
#[default]
Stderr,
Stdout,
File,
}
#[derive(Debug, Clone, Default)]
pub enum LogFormat {
#[default]
Plain,
Json,
Pretty,
}
#[derive(Debug, Clone, Default)]
pub enum RotationPolicy {
#[default]
Never,
Daily,
Hourly,
}
#[cfg(test)]
#[path = "config_tests.rs"]
mod tests;