2 releases
Uses old Rust 2015
0.4.0 |
|
---|---|
0.1.2 | Jan 15, 2023 |
0.1.1 | Jan 10, 2023 |
0.1.0 |
|
#638 in Debugging
27 downloads per month
Used in snowdrop
11KB
106 lines
styled-env-logger
This is a fork of pretty_env_logger
.
A simple logger built on top of env_logger.
It is configured via an environment variable and writes to standard
error with nice colored output for log levels.
Usage
Add the dependency to your Cargo.toml
:
[dependencies]
log = "0.4"
styled_env_logger = "0.1"
Add some usage to your application:
extern crate styled_env_logger;
#[macro_use] extern crate log;
fn main() {
styled_env_logger::init();
info!("such information");
warn!("o_O");
error!("much error");
}
Then run your app with the environmental variable set:
RUST_LOG=trace cargo run
Credit
All credit goes to @seanmonstar, I just updated the env_logger
version.
License
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or http://apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
Dependencies
~3–4.5MB
~70K SLoC