refactor(server): inline console_subscriber

This commit is contained in:
Paul Campbell 2024-04-10 11:40:42 +01:00
parent 0721b63448
commit 0b85ac3f8d

View file

@ -7,7 +7,7 @@ use kxio::network::Network;
use std::path::PathBuf; use std::path::PathBuf;
use tracing::{error, info}; use tracing::{error, info, level_filters::LevelFilter};
use crate::{ use crate::{
filesystem::FileSystem, filesystem::FileSystem,
@ -112,15 +112,14 @@ fn start_actor(
pub fn init_logging() -> Result<(), tracing::subscriber::SetGlobalDefaultError> { pub fn init_logging() -> Result<(), tracing::subscriber::SetGlobalDefaultError> {
use tracing_subscriber::prelude::*; use tracing_subscriber::prelude::*;
let console_layer = console_subscriber::ConsoleLayer::builder().spawn();
let subscriber = tracing_subscriber::fmt::layer() let subscriber = tracing_subscriber::fmt::layer()
// NOTE: set RUSTLOG in ${root}/.cargo/config // NOTE: set RUSTLOG in ${root}/.cargo/config
.with_target(false) .with_target(false)
.with_file(true) .with_file(true)
.with_line_number(true); .with_line_number(true)
.with_filter(LevelFilter::INFO);
tracing_subscriber::registry() tracing_subscriber::registry()
.with(console_layer) .with(console_subscriber::ConsoleLayer::builder().spawn())
.with(subscriber) .with(subscriber)
.init(); .init();
Ok(()) Ok(())