Make stdout logging pretty

This commit is contained in:
Tyler Hallada 2024-05-11 16:43:22 -04:00
parent 27ab839df4
commit 4a5d514cc7

View File

@ -75,7 +75,7 @@ pub fn init_tracing(
config: &Config, config: &Config,
log_sender: Sender<Bytes>, log_sender: Sender<Bytes>,
) -> Result<(WorkerGuard, WorkerGuard)> { ) -> Result<(WorkerGuard, WorkerGuard)> {
let fmt_layer = tracing_subscriber::fmt::layer(); let stdout_layer = tracing_subscriber::fmt::layer().pretty();
let filter_layer = EnvFilter::from_default_env(); let filter_layer = EnvFilter::from_default_env();
let file_appender = tracing_appender::rolling::hourly("./logs", "log"); let file_appender = tracing_appender::rolling::hourly("./logs", "log");
let (file_writer, file_writer_guard) = tracing_appender::non_blocking(file_appender); let (file_writer, file_writer_guard) = tracing_appender::non_blocking(file_appender);
@ -85,7 +85,7 @@ pub fn init_tracing(
let mem_writer_layer = tracing_subscriber::fmt::layer().with_writer(mem_writer); let mem_writer_layer = tracing_subscriber::fmt::layer().with_writer(mem_writer);
tracing_subscriber::registry() tracing_subscriber::registry()
.with(filter_layer) .with(filter_layer)
.with(fmt_layer) .with(stdout_layer)
.with(file_writer_layer) .with(file_writer_layer)
.with(mem_writer_layer) .with(mem_writer_layer)
.init(); .init();