5 unstable releases

Uses old Rust 2015

0.3.2 Aug 20, 2017
0.3.1 Aug 16, 2017
0.3.0 Aug 16, 2017
0.2.0 Aug 15, 2017
0.1.0 Aug 15, 2017

#64 in #logger

39 downloads per month
Used in primitive

MIT license

9KB
141 lines

loglog

loglog on Travis CI loglog on crates.io loglog on docs.rs

A simple and usable logger.

Usage

Create the builder:

loglog::build()

Configure the options:

loglog::build()
    .time(Some("%H:%M"))
    .stdout(true)

Finally, set up and use the logger:

loglog::build()
    .time(Some("%H:%M"))
    .stdout(true)
    .init()
    .unwrap();

info!("Hello!");

For more information, please see the documentation.

License

loglog is licensed under the MIT license. Please see the LICENSE file for more details.


lib.rs:

loglog

loglog aims to be a simple and ergonomic logger that you can drop straight into your code. It uses env_logger behind the scenes, so you can use your familiar log crate macros.

Usage

Add loglog to your Cargo.toml:

[dependencies]
log = "0.3"
loglog = "0.3"

After initializing the logger, the log crate macros will be available.

Example

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

fn main() {
    loglog::build()
        .time(Some("%H:%M"))
        .init()
        .unwrap();

    info!("This is an informational {}", "message");
    error!("This is not good!");
}

Dependencies

~4MB
~86K SLoC