Crates.io | mlog |
lib.rs | mlog |
version | 0.3.1 |
source | src |
created_at | 2019-01-12 12:12:31.738893 |
updated_at | 2019-04-04 14:32:25.903159 |
description | A logging implementation in Rust. |
homepage | |
repository | https://github.com/epsimatt/mlog |
max_upload_size | |
id | 108147 |
size | 43,152 |
A logging implementation in Rust.
#[macro_use]
extern crate log;
extern crate chrono;
extern crate mlog;
use mlog::Logger;
fn main() {
Logger::new()
.for_module("mlog_example::*", log::LevelFilter::Off)
.format(|record| {
format!(
"[{}] {}: {}",
chrono::Local::now()
.format("%H:%M:%S"),
record.level(),
record.args()
)
})
.set_default_level(log::LevelFilter::Info)
.ready()
.unwrap();
info!("hello, world!");
}