Skip to content
Port of `env_logger` as a `slog-rs` drain.
Branch: master
Clone or download
Latest commit e85ac14 Dec 15, 2017
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
examples Bump version Apr 30, 2017
src Fix unused extern crate error Sep 4, 2017
tests Bump version Apr 3, 2017
.gitignore Port to slog v2 Mar 6, 2017
.travis.yml Add .travis.yml Aug 17, 2016
CHANGELOG.md Bump version, deps, changelog Dec 15, 2017
Cargo.toml Bump version, deps, changelog Dec 15, 2017
LICENSE-APACHE Add licenses Dec 13, 2014
LICENSE-MIT Add licenses Dec 13, 2014
Makefile Port to `slog-rs` Aug 17, 2016
README.md Fix crates.io badge Oct 10, 2017

README.md

slog-rs logo
Travis CI Build Status crates.io slog-rs Gitter Chat
Documentation

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

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

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

Notable changes:

  • Support for slog-stdlog to provide support for legacy info!(...) like statements.
  • envlogger does not do any formatting anymore: slog-envlogger can be composed with any other slog-rs drains, so there's no point for it to provide it's own formatting. You can now output to a file, use JSON, have color output or any other future that slog ecosystem provides, controlling it via RUST_LOG environment var.

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 shown in simple example

For more proper (and powerful) version see proper example

Using slog-stdlog scopes you can make parts of the code log additional information (see scopes example):

You can’t perform that action at this time.