slog-envlogger - Port of env_logger as a slog-rs drain

Travis CI Build Status crates.io Gitter Chat
Documentation

env_logger is a de facto standard Rust logger implementation, which allows controlling logging to stderr via RUST_LOG environment variable.

This is a fork of env_logger that makes it work as a slog-rs drain:

Notable changes:

Status & news

Warning: Documentation has been been left mostly untouched, which means some places of it might be confusing.

How to use

See examples directory.

The simplest way to convert existing project to use slog-rs+slog-envlogger is:

```rust fn main() { slog_envlogger::init().unwrap();

error!("error");
info!("info");
trace!("trace");

} ```

More proper (and powerful) version would be:

```rust fn main() { let term = slogterm::stderr(); let drain = slogenvlogger::new(term);

let root_logger = drain.into_logger(o!("build" => "8jdkj2df", "version" => "0.1.5"));

slog_stdlog::set_logger(root_logger.clone()).unwrap();

slog_error!(root_logger, "slog error");
error!("log error");
slog_info!(root_logger, "slog info");
info!("log info");
slog_trace!(root_logger, "slog trace");
trace!("log trace");

} ```