Merge branch 'master' into overwatch-error

This commit is contained in:
Al Liu 2023-11-09 14:17:13 +08:00 committed by GitHub
commit e24e0a357b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 0 deletions

View File

@ -69,6 +69,8 @@ pub enum LoggerBackend {
Stderr, Stderr,
#[serde(skip)] #[serde(skip)]
Writer(SharedWriter), Writer(SharedWriter),
// do not collect logs
None,
} }
#[derive(Clone, Debug, Serialize, Deserialize)] #[derive(Clone, Debug, Serialize, Deserialize)]
@ -159,6 +161,12 @@ impl ServiceCore for Logger {
LoggerBackend::Stdout => tracing_appender::non_blocking(std::io::stdout()), LoggerBackend::Stdout => tracing_appender::non_blocking(std::io::stdout()),
LoggerBackend::Stderr => tracing_appender::non_blocking(std::io::stderr()), LoggerBackend::Stderr => tracing_appender::non_blocking(std::io::stderr()),
LoggerBackend::Writer(writer) => tracing_appender::non_blocking(writer), LoggerBackend::Writer(writer) => tracing_appender::non_blocking(writer),
LoggerBackend::None => {
return Ok(Self {
service_state,
worker_guard: None,
})
}
}; };
let layer = tracing_subscriber::fmt::Layer::new() let layer = tracing_subscriber::fmt::Layer::new()