first implementation of apid with target id, currently main broken

This commit is contained in:
lkoester
2023-08-15 08:49:54 +02:00
parent 698c2edb93
commit 075dc38434
8 changed files with 163 additions and 79 deletions

View File

@ -0,0 +1,22 @@
#![allow(unused_imports)]
use chrono;
use log::{debug, error, info, trace, warn};
pub fn setup_logger() -> Result<(), fern::InitError> {
fern::Dispatch::new()
.format(|out, message, record| {
out.finish(format_args!(
"{}[{}][{}] {}",
chrono::Local::now().format("[%Y-%m-%d][%H:%M:%S]"),
std::thread::current().name().expect("unnamed_thread"),
record.level(),
message
))
})
.level(log::LevelFilter::Debug)
.chain(std::io::stdout())
.chain(fern::log_file("output.log")?)
.apply()?;
Ok(())
}