A logging implementation in Rust.
#[macro_use]
extern crate log;
extern crate chrono;
extern crate mlog;
use mlog::Logger;
fn main() {
Logger::new()
.default_level(log::LevelFilter::Info)
.for_module("mlog_example::*", log::LevelFilter::Off)
.format(|record| {
format!(
"[{}] {} # {}: {}",
record.target(),
chrono::Local::now()
.format("%H:%M:%S"),
record.level(),
record.args()
)
})
.ready()
.unwrap();
trace!("hello, world!");
debug!("hello, world!");
info!("hello, world!");
warn!("hello, world!");
error!("hello, world!");
}