smart-house-web: в работе

smart-house-web: в работе
This commit is contained in:
6 changed files with 36 additions and 8 deletions

View File

@@ -0,0 +1,16 @@
pub fn init_logger() {
use tracing_subscriber::{Layer, layer::SubscriberExt, util::SubscriberInitExt};
let layer = tracing_subscriber::fmt::layer()
.with_thread_names(true)
.with_file(false)
.with_line_number(false)
.compact()
.boxed();
if let Err(e) = tracing_subscriber::registry().with(vec![layer]).try_init() {
eprintln!("Logger initialization failed: {:?}", e);
std::process::exit(1);
} else {
tracing::trace!("Logger succesfully initialized");
}
}