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

Ahmed S. Darwish darwish.07 at gmail.com
Wed Sep 16 04:26:17 PDT 2015


On Wed, Sep 16, 2015 at 01:37:05PM +0300, Tanu Kaskinen wrote:
> On Wed, 2015-09-16 at 12:28 +0200, Ahmed S. Darwish wrote:
[..]
> > 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");
> 
> Yes, that would make sense. The message should also mention that the
> request to use the journal came via an environment variable.
> 

Great, I'll send a fix by night.

Regards,

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


More information about the pulseaudio-discuss mailing list