diff --git a/spa/plugins/support/logger.c b/spa/plugins/support/logger.c index 0de15c280..ca8d93f69 100644 --- a/spa/plugins/support/logger.c +++ b/spa/plugins/support/logger.c @@ -348,6 +348,9 @@ impl_init(const struct spa_handle_factory *factory, } if (this->file == NULL) this->file = stderr; + else + setlinebuf(this->file); + if (!isatty(fileno(this->file))) this->colors = false; @@ -355,8 +358,6 @@ impl_init(const struct spa_handle_factory *factory, spa_log_debug(&this->log, NAME " %p: initialized", this); - setlinebuf(this->file); - return 0; }