use crate::{FileSpec, WriteMode};
use std::path::PathBuf;
#[derive(Debug, Clone)]
pub struct FileLogWriterConfig {
pub(crate) print_message: bool,
pub(crate) append: bool,
pub(crate) write_mode: WriteMode,
pub(crate) file_spec: FileSpec,
pub(crate) o_create_symlink: Option<PathBuf>,
pub(crate) line_ending: &'static [u8],
pub(crate) use_utc: bool,
}
impl FileLogWriterConfig {
#[must_use]
pub fn directory(&self) -> &std::path::Path {
self.file_spec.directory.as_path()
}
#[must_use]
pub fn basename(&self) -> &str {
&self.file_spec.basename
}
#[must_use]
pub fn discriminant(&self) -> Option<String> {
self.file_spec.o_discriminant.clone()
}
#[must_use]
pub fn suffix(&self) -> Option<String> {
self.file_spec.get_suffix()
}
#[must_use]
pub fn use_utc(&self) -> bool {
self.use_utc
}
#[must_use]
pub fn append(&self) -> bool {
self.append
}
#[must_use]
pub fn print_message(&self) -> bool {
self.print_message
}
}