pub struct GLogger { /* private fields */ }
Expand description
The logger. Use setup
or setup_with_options
to initiate and end
to stop.
Implementations§
Source§impl GLogger
impl GLogger
Sourcepub fn setup() -> (JoinHandle<()>, &'static GLogger)
pub fn setup() -> (JoinHandle<()>, &'static GLogger)
sets up the logger. The JoinHandle can
be used to wait for writing to end, and the logger can tell the writing thread to
end. Interchangable with setup_with_options
.
The writing thread will only end if told to.
§Examples
fn main() {
let (writer, logger) = glug::GLogger::setup();
log::info!("logged a message");
logger.end();
writer.join().unwrap();
}
Sourcepub fn setup_with_options(
options: GLoggerOptions,
) -> (JoinHandle<()>, &'static GLogger)
pub fn setup_with_options( options: GLoggerOptions, ) -> (JoinHandle<()>, &'static GLogger)
sets up the logger with options. Interchangable with GLogger::setup
§Examples
use glug::Ansi8;
fn main() {
let (writer, logger) = glug::GLogger::setup_with_options(glug::GLoggerOptions { colors:
[Ansi8::Red,Ansi8::Yellow,Ansi8::Cyan,Ansi8::Magenta,Ansi8::Blue]});
log::info!("logged a message");
logger.end();
writer.join().unwrap();
}
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for GLogger
impl RefUnwindSafe for GLogger
impl Send for GLogger
impl Sync for GLogger
impl Unpin for GLogger
impl UnwindSafe for GLogger
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