#logger #simple #logging #format #readable

simple_logger

A logger that prints all messages with a readable output format

11 releases (5 stable)

1.3.0 Jun 11, 2019
1.2.0 May 11, 2019
1.0.1 Oct 2, 2018
0.5.0 Feb 6, 2018
0.0.2 Feb 24, 2015
Download history 3673/week @ 2019-04-03 3502/week @ 2019-04-10 2680/week @ 2019-04-17 2870/week @ 2019-04-24 2661/week @ 2019-05-01 3478/week @ 2019-05-08 3962/week @ 2019-05-15 3153/week @ 2019-05-22 3902/week @ 2019-05-29 3735/week @ 2019-06-05 5658/week @ 2019-06-12 8022/week @ 2019-06-19 4798/week @ 2019-06-26 4030/week @ 2019-07-03 4312/week @ 2019-07-10

14,090 downloads per month
Used in 59 crates (56 directly)

MIT license

6KB
54 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

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

fn main() {
    simple_logger::init().unwrap();

    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

~2.5MB
~37K SLoC