pub struct Logger {
pub logging_opts: LoggingOpts,
pub local_time_default: bool,
pub timestamp_opts: TimestampOpts,
pub dir_path: Arc<Path>,
}Fields§
§logging_opts: LoggingOpts§local_time_default: boolWhat the default should be if logging_opts does not specify
a local_time setting (or specifies both ambiguously)
timestamp_opts: TimestampOpts§dir_path: Arc<Path>Implementations§
Source§impl Logger
impl Logger
pub fn current_log_path(&self) -> PathBuf
Sourcepub fn rotate_logs(&self) -> Result<()>
pub fn rotate_logs(&self) -> Result<()>
Rename the “current.log” file (if present) to “000001.log” or similar, allocating a new number, and delete old log files if there are more than configured.
Sourcepub fn redirect_to_logger(self, session_pid: Pid) -> Result<(), DaemonError>
pub fn redirect_to_logger(self, session_pid: Pid) -> Result<(), DaemonError>
Fork off a logger process (it immediately starts a new unix
session to avoid being killed when the parent process group is
killed) and redirect stdout and stderr to it. session_pid is
denoting the daemon instance (the parent process or rather
process group), it is written to the log when the parent ends
(or closes stderr and stdout). Make sure stdout and stderr are
flushed before calling this method.
Auto Trait Implementations§
impl Freeze for Logger
impl RefUnwindSafe for Logger
impl Send for Logger
impl Sync for Logger
impl Unpin for Logger
impl UnwindSafe for Logger
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