1 unstable release
0.1.0 | Dec 7, 2019 |
---|
#98 in #log-level
24 downloads per month
5KB
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");
lib.rs
:
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");
Dependencies
~88KB