pub struct LogRotatorConfig {
pub log_path: PathBuf,
pub max_size: u64,
pub max_time: Duration,
}Fields§
§log_path: PathBuf§LogRotatorConfig struct
Defines the public variables for LogRotator instanse
log_path = string
max-size = u64 (e.g 5 * 1024 * 1024)
max_time = time::Duration
max_size: u64§max_time: DurationImplementations§
Source§impl LogRotatorConfig
impl LogRotatorConfig
Sourcepub fn new(log_path: PathBuf, max_size: u64, max_time: Duration) -> Self
pub fn new(log_path: PathBuf, max_size: u64, max_time: Duration) -> Self
§LogRotatorConfig::New
The inializer for configuration of log rotator:
use logger_rust::*;
use std::time::Duration;
use std::path::PathBuf;
fn main() {
set_log_level(LogLevel::File);
set_log_path(LogConfig::Rotator(LogRotatorConfig::new(
PathBuf::from("C:/Users/qruie/Documents"), // Logging directory
5 * 1024 * 1024, // 5MB
Duration::from_secs(2), // Duration for log splits
)));
}Auto Trait Implementations§
impl Freeze for LogRotatorConfig
impl RefUnwindSafe for LogRotatorConfig
impl Send for LogRotatorConfig
impl Sync for LogRotatorConfig
impl Unpin for LogRotatorConfig
impl UnsafeUnpin for LogRotatorConfig
impl UnwindSafe for LogRotatorConfig
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