Struct rust_utils::logging::Log
source · [−]pub struct Log { /* private fields */ }
Expand description
An automatic rotating log based on the current date
It logs output like the following
[hh:mm:ss] [LEVEL]: message
Implementations
sourceimpl Log
impl Log
sourcepub fn get(log_name: &str, folder: &str) -> Log
pub fn get(log_name: &str, folder: &str) -> Log
Create a new log handle
Panics: You don’t seem to have a home folder. Make sure $HOME is set.
sourcepub fn line<T: Display>(&self, level: LogLevel, text: T, print_stdout: bool)
pub fn line<T: Display>(&self, level: LogLevel, text: T, print_stdout: bool)
Print a line to the log
This will print any object that implements Display
sourcepub fn line_basic<T: Display>(&self, text: T, print_stdout: bool)
pub fn line_basic<T: Display>(&self, text: T, print_stdout: bool)
Print a line to the log (basic info)
sourcepub fn report_panics(&self, report: bool)
pub fn report_panics(&self, report: bool)
Should this log handle be used to report application panics? This creates a panic handler that logs the thread panicked, where the panic occurred in the source and the backtrace.
This could be useful in conjunction with libraries that block stdout/stderr like cursive
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Log
impl Send for Log
impl Sync for Log
impl Unpin for Log
impl UnwindSafe for Log
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