12 releases

new 0.5.0 Sep 13, 2020
0.4.3 Nov 17, 2019
0.4.1 Jul 1, 2018
0.3.0 Feb 18, 2018
0.2.1 Jun 6, 2016

#12 in Debugging

Download history 1875/week @ 2020-05-30 1538/week @ 2020-06-06 1622/week @ 2020-06-13 1464/week @ 2020-06-20 1265/week @ 2020-06-27 3093/week @ 2020-07-04 2317/week @ 2020-07-11 2240/week @ 2020-07-18 1803/week @ 2020-07-25 2149/week @ 2020-08-01 2724/week @ 2020-08-08 2222/week @ 2020-08-15 2202/week @ 2020-08-22 2333/week @ 2020-08-29 2722/week @ 2020-09-05 2775/week @ 2020-09-12

9,301 downloads per month
Used in 77 crates (64 directly)

MIT/Apache

22KB
266 lines

Build status Build status Average time to resolve an issue Percentage of issues still open Rust version Documentation Latest version All downloads Downloads of latest version

Logger that aims to provide a simple case of env_logger that just logs to stderr based on verbosity.

Documentation

For a working example for StructOpt, clap, and docopt please see the crate level documentation.

For example binaries showing how module level logging works, please see the large-example crate in examples/.

Supported Versions

  • stderrlog 0.5.x supports
    1. Rust 1.31.0 and newer
    2. log >= 0.4.11
  • stderrlog 0.4.x supports
    1. Rust 1.16.0 and newer
    2. log >= 0.4.1
  • stderrlog 0.3.x supports
    1. Rust 1.16.0 and newer
    2. log 0.3.x
  • stderrlog 0.2.x supports
    1. Rust 1.13.0 and newer
    2. log >= 0.3.0, < 0.3.9

Usage

Add this to your Cargo.toml:

[dependencies]
stderrlog = "0.4"

and this to your main():

stderrlog::new().verbosity(args.flag_v).quiet(args.flag_q).init().unwrap();

where your args struct is defined as:

struct Args {
    flag_v: usize,
    flag_q: bool,
    ...
}

Dependencies

~1MB
~17K SLoC