Struct dzahui::logger::LogWriter

source ·
pub struct LogWriter {
    pub log_path: PathBuf,
    pub line_count: u64,
    pub line_maximum: u64,
    pub current_log_file_number: i64,
    pub log_file: File,
    pub rx: Receiver<String>,
}
Expand description

General Information

Struct that writes logs to files. Changes files when maximum number of lines has been reached.

Fields

  • log_path - Direction in which files will be generated
  • line_count - Number of lines currently written
  • line_maximum - Maximum number of lines per file
  • current_log_file_number - Number of current file in which logs are being written
  • log_file - Current log file
  • rx - Used for internal communication between log, warn and error in this structure

Fields§

§log_path: PathBuf§line_count: u64§line_maximum: u64§current_log_file_number: i64§log_file: File§rx: Receiver<String>

Implementations§

General Information

Creates new instance of LogWriter while taking into account previous log files, last log file and state of last log file

Parameters
  • log_path - A path-like object where all logs remain
  • rx - A receiver for internal communication
  • line_maximum - Maximum number of lines for log file
General Information

Writes to log file and changes internal values like line number and log file if necessary

Parameters
  • &mut self - A mutable reference to write and change internal state

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The alignment of pointer.
The type for initializers.
Initializes a with the given initializer. Read more
Dereferences the given pointer. Read more
Mutably dereferences the given pointer. Read more
Drops the object pointed to by the given pointer. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.