pub struct LogFast {
pub filename: String,
/* private fields */
}
Expand description
Holds the LogFast housekeeping
Fields
filename: String
filename that the LogFast thread is writing to
Implementations
sourceimpl LogFast
impl LogFast
sourcepub fn new(filename: &str, buffer_size: usize) -> Result<LogFast, String>
pub fn new(filename: &str, buffer_size: usize) -> Result<LogFast, String>
Creates a new LogFast
thread logger
Parameters
filename
is the path to the file we want to write logs to
buffer_size
is the size of the buffer to hold yet-to-be-flushed messages
Example
ⓘ
let buffer_size = 100;
let lf = match LogFast::new("my.log", buffer_size).unwrap();
sourcepub fn log(&mut self, msg: &str)
pub fn log(&mut self, msg: &str)
Send a new log message to the LogFast
thread, to be flushed ASAP
Parameters
msg
is the log message you want to eventually be written
Example
ⓘ
lf.log("Here's a test log line");
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for LogFast
impl Send for LogFast
impl Sync for LogFast
impl Unpin for LogFast
impl UnwindSafe for LogFast
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more