Expand description
dumb_logger is a minimal logging module.
It allows you to use the log macros error!, warn!,
info!, debug! and trace! to print to stdout.
It has no dependencies other than log. It doesn’t print timestamps or
sequence numbers or print in color. It just prints the message that was
logged.
How to use it:
use log::trace;
dumb_logger::init();
trace!("hello world");If you want to change the max log level during init:
use log::{trace, Level};
dumb_logger::init_with_level(Level::Info);
trace!("this won't print");If you want to change the max log level at runtime:
use log::{trace, Level};
dumb_logger::init_with_level(Level::Info);
dumb_logger::set_max(Level::Trace);
trace!("this will print");Functions§
- init
- Initialize logging with a max log level of Trace (everything will be printed).
- init_
with_ level - Initialize logging with a specified max log level.
- set_max
- Set the max log level. Messages with a lower level will no longer be printed.