#debugging #development #logging

easy-logging

An easy way to get logging working in your CLI tool

1 unstable release

0.1.0 Sep 30, 2018

#8 in #development

Download history 1/week @ 2018-10-07 11/week @ 2018-10-14 24/week @ 2018-10-28 8/week @ 2018-11-04 9/week @ 2018-11-11 2/week @ 2018-11-18 4/week @ 2018-11-25 5/week @ 2018-12-02 19/week @ 2018-12-09 9/week @ 2018-12-16 9/week @ 2018-12-23 3/week @ 2019-01-06 4/week @ 2019-01-13

2 downloads per month

Unlicense

8KB
146 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
~16K SLoC