#logger #simple #logging #readable #format

simple_logger

A logger that prints all messages with a readable output format

18 releases (stable)

1.11.0 Oct 8, 2020
1.9.0 Sep 2, 2020
1.6.0 Feb 25, 2020
1.3.0 Jun 11, 2019
0.3.1 Mar 30, 2015
Download history 13817/week @ 2020-11-06 16555/week @ 2020-11-13 15289/week @ 2020-11-20 13281/week @ 2020-11-27 12573/week @ 2020-12-04 11835/week @ 2020-12-11 10900/week @ 2020-12-18 7799/week @ 2020-12-25 11487/week @ 2021-01-01 13578/week @ 2021-01-08 12570/week @ 2021-01-15 12309/week @ 2021-01-22 12284/week @ 2021-01-29 13233/week @ 2021-02-05 15248/week @ 2021-02-12 13865/week @ 2021-02-19

49,194 downloads per month
Used in 206 crates (184 directly)

MIT license

15KB
209 lines

simple_logger

A logger that prints all messages with a readable output format.

The output format is based on the format used by Supervisord.

Usage

use simple_logger::SimpleLogger

fn main() {
    SimpleLogger::new().init().unwrap();

    log::warn!("This is an example message.");
}

This outputs:

2015-02-24 01:05:20 WARN [logging_example] This is an example message.

You can run the above example with:

cargo run --example init

If you want to remove the colorized output and its dependencies, add the the following to your Cargo.toml:

[dependencies.simple_logger]
default-features = false

Licence

simple_logger is licenced under the MIT Licence.

Authors

Written by Sam Clements.

Dependencies

~1MB
~16K SLoC