Output coloured pageserver logs for tty stdout

This commit is contained in:
Kirill Bulatov
2023-01-23 14:41:09 +02:00
committed by Kirill Bulatov
parent a4be54d21f
commit fd18692dfb
3 changed files with 3 additions and 1 deletions

1
Cargo.lock generated
View File

@@ -4157,6 +4157,7 @@ version = "0.1.0"
dependencies = [
"anyhow",
"async-trait",
"atty",
"bincode",
"byteorder",
"bytes",

View File

@@ -5,6 +5,7 @@ edition.workspace = true
license.workspace = true
[dependencies]
atty.workspace = true
sentry.workspace = true
async-trait.workspace = true
anyhow.workspace = true

View File

@@ -34,7 +34,7 @@ pub fn init(log_format: LogFormat) -> anyhow::Result<()> {
let base_logger = tracing_subscriber::fmt()
.with_env_filter(env_filter)
.with_target(false)
.with_ansi(false)
.with_ansi(atty::is(atty::Stream::Stdout))
.with_writer(std::io::stdout);
match log_format {