Expand description
Logger with graphical elements. For use with log
crate.
The logger writes to stderr with ANSI escape codes to display logs and aggregate data.
Could be useful if a program or library logs en masse.
§How to use
The glug
logger uses a dedicated writer thread. This thread runs until told to stop. To stop
the logger properly, it is a good idea to use GLogger::end
and JoinHandle::join
like so:
(yes, this example is everywhere in this doc)
fn main() {
let (writer, logger) = glug::GLogger::setup();
log::info!("logged a message");
logger.end();
writer.join().unwrap();
}
Structs§
- GLogger
- The logger. Use
setup
orsetup_with_options
to initiate andend
to stop. - GLogger
Options - Ways to configure the logger. These include: colors. 0.2.0 will expand these, if it ever gets made.
Enums§
- Ansi8
- the numbers for the basic ANSI colors set by the terminal. These are the widely used colors for the terminal, not specific ones. They may not be the right color as they are terminal dependent.