JaneDoe-ZS/nap_common/src/logging.rs
xeon 9af61cd33f simple CLI command system
Implement CLI command system
command for changing player's frontend avatar
2024-07-22 19:47:04 +03:00

18 lines
455 B
Rust

use env_logger::Target;
use rustyline_async::SharedWriter;
use tracing_log::log::LevelFilter;
pub fn init_tracing(out: Option<SharedWriter>) {
#[cfg(target_os = "windows")]
ansi_term::enable_ansi_support().unwrap();
let target = match out {
Some(out) => Target::Pipe(Box::new(out)),
None => Target::Stdout,
};
env_logger::builder()
.target(target)
.filter(None, LevelFilter::Info)
.init();
}