Crate styled_env_logger
source ·Expand description
A logger configured via an environment variable which writes to standard error with nice colored output for log levels.
Example
extern crate styled_env_logger;
#[macro_use] extern crate log;
fn main() {
styled_env_logger::init();
trace!("a trace example");
debug!("deboogging");
info!("such information");
warn!("o_O");
error!("boom");
}
Run the program with the environment variable RUST_LOG=trace
.
Defaults
The defaults can be setup by calling init()
or try_init()
at the start
of the program.
Enable logging
This crate uses env_logger internally, so the same ways of enabling logs through an environment variable are supported.
Functions
Returns a
env_logger::Builder
for further customization.Returns a
env_logger::Builder
for further customization.Initializes the global logger with a styled env logger.
Initialized the global logger with a styled env logger, with a custom variable name.
Initializes the global logger with a timed styled env logger.
Initializes the global logger with a sty env logger.
Initialized the global logger with a styled env logger, with a custom variable name.
Initializes the global logger with a timed styled env logger.
Initialized the global logger with a timed styled env logger, with a custom variable name.