#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 4124/week @ 2019-07-28 4516/week @ 2019-08-04 5445/week @ 2019-08-11 5457/week @ 2019-08-18 5032/week @ 2019-08-25 4834/week @ 2019-09-01 5452/week @ 2019-09-08 5136/week @ 2019-09-15 4798/week @ 2019-09-22 5762/week @ 2019-09-29 5886/week @ 2019-10-06 7237/week @ 2019-10-13 5654/week @ 2019-10-20 6162/week @ 2019-10-27 7616/week @ 2019-11-03

14,090 downloads per month
Used in 77 crates (73 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

~1MB
~14K SLoC