From eb396f1ea8f80df9958c428be5f02a1d7c176f4d Mon Sep 17 00:00:00 2001 From: Pauli Virtanen Date: Mon, 5 Apr 2021 14:34:56 +0300 Subject: [PATCH] pipewire: add environment variable for disabling journald logging Logging to journald can be annoying at high debug levels, so add an easy way to disable it. --- README.md | 1 + src/pipewire/pipewire.c | 9 ++++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index a80dbfc69..09a8d46cd 100644 --- a/README.md +++ b/README.md @@ -40,6 +40,7 @@ applications: * `PIPEWIRE_DEBUG=` to increase the debug level * `PIPEWIRE_LOG=` to redirect log to filename +* `PIPEWIRE_LOG_SYSTEMD=false` to disable logging to systemd journal * `PIPEWIRE_LATENCY=` to configure latency as a fraction. 10/1000 configures a 10ms latency. Usually this is expressed as a fraction of the samplerate, diff --git a/src/pipewire/pipewire.c b/src/pipewire/pipewire.c index ad9a84182..d845fcdd7 100644 --- a/src/pipewire/pipewire.c +++ b/src/pipewire/pipewire.c @@ -441,9 +441,12 @@ void pw_init(int *argc, char **argv[]) pw_log_set(log); #ifdef HAVE_SYSTEMD - log = load_journal_logger(support); - if (log) - pw_log_set(log); + if ((str = getenv("PIPEWIRE_LOG_SYSTEMD")) == NULL || + strcmp(str, "true") == 0 || atoi(str) != 0) { + log = load_journal_logger(support); + if (log) + pw_log_set(log); + } #endif } else { support->support[support->n_support++] =