sat-rs/satrs-example/src/logging.rs
Robin Mueller 58544fac7a Various fixes and updates
- Make test event work
- Improved pyclient capabilities and split it up a bit
2023-02-16 01:02:14 +01:00

17 lines
541 B
Rust

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]"),
record.target(), //(std::thread::current().name().expect("unnamed_thread"),
record.level(),
message
))
})
.level(log::LevelFilter::Debug)
.chain(std::io::stdout())
.apply()?;
Ok(())
}