diff options
author | Ahmed S. Darwish <darwish.07@gmail.com> | 2015-09-16 23:38:38 +0200 |
---|---|---|
committer | Tanu Kaskinen <tanuk@iki.fi> | 2015-09-25 15:05:43 +0300 |
commit | 5d4905ec3145cb62eb27ab7fdefba083196c1178 (patch) | |
tree | 9143ae7afcf540ade6b431f19c6f65feb06d608e | |
parent | ac5b7b8d5cbf53c68fb39ae27f54a69894d50d01 (diff) | |
download | pulseaudio-5d4905ec3145cb62eb27ab7fdefba083196c1178.tar.gz |
log: Fix compilation error on non-systemd systems
Commit 262bdae0330e used symbols which are only available if systemd
support was compiled in. Fix by using the appropriate #ifdef guards.
Also document the resulting PULSE_LOG_JOURNAL environment variable
behavior if systemd journal support was not compiled in.
[Diwic: changed wording slightly.]
Reported-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Ahmed S. Darwish <darwish.07@gmail.com>
-rw-r--r-- | src/pulse/pulseaudio.h | 3 | ||||
-rw-r--r-- | src/pulsecore/log.c | 2 |
2 files changed, 4 insertions, 1 deletions
diff --git a/src/pulse/pulseaudio.h b/src/pulse/pulseaudio.h index 5077e3b81..063d5e230 100644 --- a/src/pulse/pulseaudio.h +++ b/src/pulse/pulseaudio.h @@ -147,7 +147,8 @@ * and function are included by default through the journal fields * `CODE_FILE`, `CODE_FUNC`, and `CODE_LINE`. Any backtrace attached to * the logging message is sent through the PulseAudio-specific journal - * field `PULSE_BACKTRACE`. + * field `PULSE_BACKTRACE`. This environment variable has no effect if + * PulseAudio was compiled without systemd journal support. * - `PULSE_LOG_COLORS`: If defined, enables colored logging output. * - `PULSE_LOG_TIME`: If defined, include timestamps with each message. * - `PULSE_LOG_FILE`: If defined, include each message originating file diff --git a/src/pulsecore/log.c b/src/pulsecore/log.c index 34ed0415f..3c876f695 100644 --- a/src/pulsecore/log.c +++ b/src/pulsecore/log.c @@ -294,10 +294,12 @@ static void init_defaults(void) { target_override_set = true; } +#ifdef HAVE_SYSTEMD_JOURNAL if (getenv(ENV_LOG_JOURNAL)) { target_override = PA_LOG_JOURNAL; target_override_set = true; } +#endif if ((e = getenv(ENV_LOG_LEVEL))) { maximum_level_override = (pa_log_level_t) atoi(e); |