[pulseaudio-discuss] [PATCH] pulsecore: Introduce PULSE_LOG_JOURNAL environment variable

Ahmed S. Darwish darwish.07 at gmail.com
Wed Sep 16 03:28:42 PDT 2015


[ Tanu, your MUA sometimes drops CCs. I'm the target this time ;-) ]

On Wed, Sep 16, 2015 at 12:51:29PM +0300, Tanu Kaskinen wrote:
> On Wed, 2015-09-16 at 11:36 +0200, David Henningsson wrote:
> > Due to this patch, my build (of -next) is now broken:
> > 
> > ../../src/pulsecore/log.c: In function 'init_defaults':
> > ../../src/pulsecore/log.c:298:31: error: 'PA_LOG_JOURNAL' undeclared 
> > (first use in this function)
> >               target_override = PA_LOG_JOURNAL;
> >                                 ^
> > 
> > ...probably because I don't HAVE_SYSTEMD_JOURNAL.
> > 
> > I kind of feel it would be better to have PA_LOG_JOURNAL always defined 
> > than to add ifdefs every where we use it, but I'm open for either 
> > option. Any opinions?
> 
> So this failing code is in init_defaults():
> 
>         if (getenv(ENV_LOG_JOURNAL)) {
>             target_override = PA_LOG_JOURNAL;
>             target_override_set = true;
>         }
> 
> In this case I feel it's better to just #ifdef that code out. Even if
> PA_LOG_JOURNAL was defined, I think this code should be compiled out,
> because I don't think we want to set target_override when the target in
> question isn't supported.
>

Shouldn't we also add a small warning to the user in this case?
Something like:

        pa_log_warn("Cannot send logging messages to the jornal; "
                    "systemd journal support was not compiled");

Thanks,

-- 
Darwish
http://darwish.chasingpointers.com


More information about the pulseaudio-discuss mailing list