glog/examples/demo.rs

19 lines
353 B
Rust

use log::{debug, error, info, trace, warn};
use std::thread;
use glog;
fn main() -> Result<(), Box<dyn std::error::Error>> {
glog::init()?;
trace!("trace!");
debug!("debug!");
info!("info!");
warn!("warn!");
error!("error!");
let handle = thread::spawn(|| error!("from a second thread"));
handle.join();
Ok(())
}