From cc4324cd301c42d2342c6bf1a39f0a6d0980c730 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Fri, 7 May 2021 12:52:40 +1000 Subject: [PATCH] spa/logger: only log in colors if we're logging to a tty --- spa/plugins/support/logger.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/spa/plugins/support/logger.c b/spa/plugins/support/logger.c index ffd57e963..b4ccb3279 100644 --- a/spa/plugins/support/logger.c +++ b/spa/plugins/support/logger.c @@ -280,6 +280,8 @@ impl_init(const struct spa_handle_factory *factory, } if (this->file == NULL) this->file = stderr; + if (!isatty(fileno(this->file))) + this->colors = false; spa_ringbuffer_init(&this->trace_rb);