1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
|
# pretty-env-logger
[](https://crates.io/crates/pretty_env_logger)
[](https://docs.rs/pretty_env_logger)
[](https://crates.io/crates/pretty_env_logger)
[](https://travis-ci.org/seanmonstar/pretty-env-logger)
A simple logger built on top of [env_logger](https://docs.rs/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`:
```toml
[dependencies]
log = "0.4"
pretty_env_logger = "0.4"
```
Add some usage to your application:
```rust
extern crate pretty_env_logger;
#[macro_use] extern crate log;
fn main() {
pretty_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
```
## License
Licensed under either of
- Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or http://apache.org/licenses/LICENSE-2.0)
- MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)
|