[![log-badge]][log] [![env_logger-badge]][env_logger] [![cat-debugging-badge]][cat-debugging]
使用Builder::target
创建一个自定义记录器配置,将日志输出的目标设置为Target::Stdout
。
#[macro_use]
extern crate log;
extern crate env_logger;
use env_logger::{Builder, Target};
fn main() {
Builder::new()
.target(Target::Stdout)
.init();
error!("This error has been printed to Stdout");
}