forked from NewEriduPubSec/JaneDoe-ZS
18 lines
455 B
Rust
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();
|
|
}
|