Skip to content

Rust log implementation that logs to stderr based on verbosity specified supports macros and colors

License

Notifications You must be signed in to change notification settings

eugenesvk/stderrlog-rs

This branch is 1 commit ahead of cardoe/stderrlog-rs:master.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

966708d · Jan 28, 2025
Feb 13, 2024
May 30, 2020
Jan 31, 2024
Jan 31, 2024
Jan 31, 2024
May 11, 2016
Jun 12, 2023
Jun 12, 2023
Jan 28, 2025
May 11, 2016
Feb 7, 2022
Jun 12, 2023
Jul 2, 2022
Jul 1, 2018
May 11, 2016

Repository files navigation

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.6.x supports
    1. Rust 1.48.0 and newer
    2. log >= 0.4.11
  • stderrlog 0.5.x supports
    1. Rust 1.36.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,
    ...
}

About

Rust log implementation that logs to stderr based on verbosity specified supports macros and colors

Resources

License

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Rust 100.0%