Struct Config
pub struct Config {
directory: AbsolutePath,
filename_prefix: SafeFilename,
filename_suffix: SafeFilename,
max_log_files: usize,
rotation: SerdeRotation,
}Available on crate feature
file only.Expand description
File logging configuration.
§Example Serialization
directory = "/var/log/humpback" # Required.
filename_prefix = "hb" # Required.
filename_suffix = "log" # Optional. Default is "log".
max_log_files = 10 # Optional. Default is 10.
rotation = "daily" # Optional. Default is "daily". One of "minutely", "hourly", "daily", "never".Fields§
§directory: AbsolutePath§filename_prefix: SafeFilename§filename_suffix: SafeFilename§max_log_files: usize§rotation: SerdeRotationImplementations§
§impl Config
impl Config
pub fn filename_prefix(&self) -> &str
pub fn filename_prefix(&self) -> &str
Returns the filename prefix for log files.
pub fn filename_suffix(&self) -> &str
pub fn filename_suffix(&self) -> &str
Returns the filename suffix for log files.
pub const fn max_log_files(&self) -> usize
pub const fn max_log_files(&self) -> usize
Returns the maximum number of log files to keep.
pub const fn rotation(&self) -> Rotation
pub const fn rotation(&self) -> Rotation
Returns the rotation policy for log files.
Trait Implementations§
§impl<'de> Deserialize<'de> for Config
impl<'de> Deserialize<'de> for Config
§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnwindSafe for Config
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more