Git Product home page Git Product logo

envlogger's Introduction

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):

envlogger's People

Contributors

alexcrichton avatar amanieu avatar apasel422 avatar aturon avatar belltoy avatar brson avatar carols10cents avatar dpc avatar drbawb avatar frewsxcv avatar grbritz avatar huonw avatar kintaro avatar lambda avatar maurer avatar mbrubeck avatar sanmai-nl avatar scott-ainsworth avatar sfackler avatar sinistersnare avatar steveklabnik avatar suhr avatar tomjakubowski avatar vhbit avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.