#debugging #development #logging

easy-logging

An easy way to get logging working in your CLI tool

3 releases

Uses old Rust 2015

0.1.2 May 10, 2021
0.1.1 Aug 16, 2019
0.1.0 Sep 30, 2018

#258 in Debugging

Download history 54/week @ 2022-06-02 15/week @ 2022-06-09 23/week @ 2022-06-16 48/week @ 2022-06-23 24/week @ 2022-06-30 22/week @ 2022-07-07 32/week @ 2022-07-14 48/week @ 2022-07-21 40/week @ 2022-07-28 54/week @ 2022-08-04 60/week @ 2022-08-11 35/week @ 2022-08-18 25/week @ 2022-08-25 37/week @ 2022-09-01 78/week @ 2022-09-08 42/week @ 2022-09-15

182 downloads per month
Used in 2 crates

Unlicense

8KB
148 lines

easy-logging

An easy way to get logging working in your command line tool. Suitable for simple CLI and prototyping.

Requires a single function call and provides colored logging to stdout/stderr out of the box.

Usage

Add to your Cargo.toml:

[dependencies]
easy-logging = "*"

Example:

extern crate easy_logging;
#[macro_use] extern crate log;

fn main() {
    easy_logging::init(module_path!(), log::Level::Info).unwrap();
    debug!("Test debug message.");
    info!("Test info message.");
}

Output with enabled info level:

I: Test info message.

Output with enabled debug level:

[22:29:18.084] [   main.rs:006] D: Test debug message.
[22:29:18.085] [   main.rs:007] I: Test info message.

Dependencies

~1.5MB
~20K SLoC