spa/logger: only log in colors if we're logging to a tty

This commit is contained in:
Peter Hutterer 2021-05-07 12:52:40 +10:00 committed by Wim Taymans
parent af63d08453
commit cc4324cd30

View file

@ -280,6 +280,8 @@ impl_init(const struct spa_handle_factory *factory,
} }
if (this->file == NULL) if (this->file == NULL)
this->file = stderr; this->file = stderr;
if (!isatty(fileno(this->file)))
this->colors = false;
spa_ringbuffer_init(&this->trace_rb); spa_ringbuffer_init(&this->trace_rb);