• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

benches/H03-May-2022-219181

examples/H03-May-2022-223172

src/H03-May-2022-570270

tests/H03-May-2022-256215

.cargo-checksum.jsonH A D03-May-202289 11

.cargo_vcs_info.jsonH A D01-Jan-197074 65

.gitignoreH A D11-May-201626 43

.travis.ymlH A D16-Nov-2019531 2120

CHANGELOG.mdH A D17-Nov-20191.4 KiB6941

Cargo.lockH A D01-Jan-197019.8 KiB451398

Cargo.tomlH A D01-Jan-19701.8 KiB7157

Cargo.toml.orig-cargoH A D17-Nov-20191.1 KiB3531

LICENSE-APACHEH A D11-May-201610.6 KiB202169

LICENSE-MITH A D11-May-20161 KiB2622

README.mdH A D01-Jul-20182.3 KiB6751

appveyor.ymlH A D01-Jul-2018882 2724

rustfmt.tomlH A D11-May-201646 32

README.md

1[![Build status](https://travis-ci.org/cardoe/stderrlog-rs.svg?branch=master)](https://travis-ci.org/cardoe/stderrlog-rs)
2[![Build status](https://ci.appveyor.com/api/projects/status/no8slwtoy5va0w4g/branch/master?svg=true)](https://ci.appveyor.com/project/cardoe/stderrlog-rs/branch/master)
3[![Average time to resolve an issue](http://isitmaintained.com/badge/resolution/cardoe/stderrlog-rs.svg)](http://isitmaintained.com/project/cardoe/stderrlog-rs "Average time to resolve an issue")
4[![Percentage of issues still open](http://isitmaintained.com/badge/open/cardoe/stderrlog-rs.svg)](http://isitmaintained.com/project/cardoe/stderrlog-rs "Percentage of issues still open")
5[![Rust version]( https://img.shields.io/badge/rust-1.16+-blue.svg)]()
6[![Documentation](https://docs.rs/stderrlog/badge.svg)](https://docs.rs/stderrlog)
7[![Latest version](https://img.shields.io/crates/v/stderrlog.svg)](https://crates.io/crates/stderrlog)
8[![All downloads](https://img.shields.io/crates/d/stderrlog.svg)](https://crates.io/crates/stderrlog)
9[![Downloads of latest version](https://img.shields.io/crates/dv/stderrlog.svg)](https://crates.io/crates/stderrlog)
10
11Logger that aims to provide a simple case of
12[env_logger](https://crates.io/crates/env_logger) that just
13logs to `stderr` based on verbosity.
14
15## Documentation
16
17For a working example for [StructOpt](https::/crates.io/crates/structopt),
18[clap](https://crates.io/crates/clap), and
19[docopt](https://crates.io/crates/docopt) please see the
20[crate level documentation](https://docs.rs/stderrlog/*/stderrlog/).
21
22For example binaries showing how
23[module level logging](https://github.com/cardoe/stderrlog-rs/tree/master/examples/large-example) works, please see the `large-example` crate in `examples/`.
24
25## Supported Versions
26
27* `stderrlog` 0.4.x supports
28  1) Rust 1.16.0 and newer
29  2) `log` >= 0.4.1
30* `stderrlog` 0.3.x supports
31  1) Rust 1.16.0 and newer
32  2) `log` 0.3.x
33* `stderrlog` 0.2.x supports
34  1) Rust 1.13.0 and newer
35  2) `log` >= 0.3.0,  < 0.3.9
36
37## Usage
38
39Add this to your `Cargo.toml`:
40
41```toml
42[dependencies]
43stderrlog = "0.4"
44```
45
46and this to your crate root:
47
48```rust
49extern crate stderrlog;
50```
51
52and this to your main():
53
54```rust
55stderrlog::new().verbosity(args.flag_v).quiet(args.flag_q).init().unwrap();
56```
57
58where your args struct is defined as:
59
60```rust
61struct Args {
62    flag_v: usize,
63    flag_q: bool,
64    ...
65}
66```
67