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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
use crate::{Cleanup, Criterion, FileSpec, Naming, WriteMode};
use std::path::PathBuf;
#[derive(Clone, Debug)]
pub struct RotationConfig {
pub(crate) criterion: Criterion,
pub(crate) naming: Naming,
pub(crate) cleanup: Cleanup,
}
#[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.o_suffix.clone()
}
#[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
}
}