#log #logger #format

fmtlog

A simple configurable logger with format specification

3 releases

0.1.4 Jan 30, 2021
0.1.3 Jan 30, 2021
0.1.2 Jan 18, 2021
0.1.1 Jan 18, 2021
0.1.0 Jan 17, 2021

#192 in Debugging

Download history 36/week @ 2022-05-30 15/week @ 2022-06-06 8/week @ 2022-06-13 17/week @ 2022-06-20 9/week @ 2022-06-27 12/week @ 2022-07-04 19/week @ 2022-07-11 11/week @ 2022-07-18 16/week @ 2022-07-25 13/week @ 2022-08-01 30/week @ 2022-08-08 12/week @ 2022-08-15 21/week @ 2022-08-22 10/week @ 2022-08-29 28/week @ 2022-09-05 18/week @ 2022-09-12

79 downloads per month
Used in 2 crates

MIT license

45KB
977 lines

fmtlog

crates.io docs.rs Downloads Downloads (latest) License

A simple configurable logger with format specification.

detail1

For more formats, see the Formats Collection.

Usage

Add to your Cargo.toml:

[dependencies]
log = "0.4"
fmtlog = "0.1.3"

These features are included by the default, but you can remove these features.

Feature Description
chrono Enable timestamps.
colored Coloring the log.

Like this:

[dependencies.fmtlog]
version = "0.1.3"
default-features = false
features = ["chrono"]  

and initialize the logger in your code:

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

fn main() {
    fmtlog::default()
        .set()
        .unwrap();

    error!("Something has failed.");

    // ...
}

For advanced usage, read the API document.

Features

  • Format Specification
  • Module-level Logging
  • Timestamps Support
  • Colorized Log
  • Logging to the File
  • Multiple log target

Documents

API Documents are available on docs.rs.

Author

License

This program is licensed under the MIT license.

See LICENSE for details.

Dependencies

~1MB
~20K SLoC