You've already forked authentication-service
mirror of
https://github.com/matrix-org/matrix-authentication-service.git
synced 2025-08-09 04:22:45 +03:00
Minor logging improvements
- only have colors if the output terminal is a tty - log in a non-blocking fashion
This commit is contained in:
@@ -112,7 +112,10 @@ async fn try_main() -> anyhow::Result<()> {
|
||||
|
||||
// Setup logging
|
||||
// This writes logs to stderr
|
||||
let fmt_layer = tracing_subscriber::fmt::layer().with_writer(std::io::stderr);
|
||||
let (log_writer, _guard) = tracing_appender::non_blocking(std::io::stderr());
|
||||
let fmt_layer = tracing_subscriber::fmt::layer()
|
||||
.with_writer(log_writer)
|
||||
.with_ansi(atty::is(atty::Stream::Stderr));
|
||||
let filter_layer = EnvFilter::try_from_default_env()
|
||||
.or_else(|_| EnvFilter::try_new("info"))
|
||||
.context("could not setup logging filter")?;
|
||||
|
Reference in New Issue
Block a user