[RFC] syslog output from SAL_* messages

Riccardo Magliocchetti riccardo.magliocchetti at gmail.com
Tue Dec 18 14:55:33 PST 2012


Hello Stephan,

Il 18/12/2012 09:42, Stephan Bergmann ha scritto:
> On 12/17/2012 09:15 PM, Riccardo Magliocchetti wrote:
>> i've refreshed my patch for adding possibility to send SAL_* messages to
>> syslog. I have two issues:
>> - am not able to send the ENABLE_SYSLOG definition down to
>> sal/osl/unx/salinit.cxx
>
> You need to add it to config_host.mk.in to have it visible in
> solenv/gbuild/gbuild.mk (or use the newly introduced mechanism of adding
> a config/config_*.h that you then include in sal/osl/unx/salinit.cxx,
> removing the change from solenv/gbuild/gbuild.mk again).

I've taken the approach suggested by Tor

>> - if i add calls to SAL_INFO in vcl/headless/headlessinst.cxx like, i
>> see the fprintf but i don't see the SAL_INFO one. Tried with SAL_WARN,
>> same result.
>
> Did you configure --enable-dbgutil or at least --enable-debug?

No and that was one of the causes of not seeing them :) why this SAL 
messages are shown only on debug build?

> Also, the definition of sal_use_syslog in sal/osl/all/log.cxx is in an
> unnamed namespace, so the extern declaration in sal/osl/unx/salinit.cxx
> is unrelated (and the code should result in a link error?); so move the
> definition out of the unnamed namespace. It would be best to place the
> extern declaration into a header anyway, but it looks like there is no
> good header directory that would be included from both sal/osl/all and
> sal/osl/unx, so short of that please at least add comments to the
> declaration and definition linking those two together across the two
> .cxx files. And in any case, wrap sal_use_syslog in #ifdef ENABLE_SYSLOG.

Done, new patch attached, still have to compile with --enable-debug so 
haven't see if it works but at least now it initialize correctly :) More 
testing tomorrow.

BTW added a printf in sal_detail_initialize and seeing it called twice 
on startup, is it expected?

compiled with:
./autogen.sh --with-parallelism=4 --without-java --enable-headless 
--enable-symbols
run with:
SAL_LOG_SYSLOG=1 SAL_LOG=+INFO.vcl 
/usr/local/lib/libreoffice/program/soffice 
"--accept=socket,host=localhost,port=2002;urp;"

thanks,
riccardo
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Add-ability-to-send-SAL_-messages-to-syslog.patch
Type: text/x-diff
Size: 4910 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/libreoffice/attachments/20121218/6ffe1227/attachment.patch>


More information about the LibreOffice mailing list