Date: prev next · Thread: first prev next last
2012 Archives by date, by thread · List index



On Tue, 2012-08-07 at 09:23 +0200, Stephan Bergmann wrote:
Folks, please do not pollute the sources with fprintf in the first 
place.

        Of course that doesn't belong in master but ...

  Use SAL_INFO/SAL_WARN for permanent warning code (see 
<http://wiki.documentfoundation.org/Development#Assertions_and_Logging>), and 
use SAL_DEBUG for temporary debug output (that the LO git commit hooks 
will prevent from accidentally becoming permanent).

        I always use fprintf and never these other things. I can never remember
how to make SAL_WARN / SAL_INFO / SAL_DEBUG to actually output something
and grok their prefix behaviour etc.; on the occasions I've tried adding
one of those I inevitably have to do 2x compilation loops before giving
up and using fprintf - IIRC you have to use some different compile
flags, and/or set some also-difficult-to-remember environment variable
to some value - right ?

        fprintf (stderr,"foo\n");

        goes directly, atomically to your terminal pausing the app until it's
out and it -just-works- (TM) ;-)

        And - unfortunately, there's no way re-explaining it is going to help
me remember the detail ;-) -possibly- adding a:

        ./soffice --help-debug

        section that explains what to set SAL_LOG to, and some of the other
environment variables to set to debug various other things might help
keep that near the front of people's minds but ...

        Quite possibly if we want to keep fprintf's out we want to add a git
hook that excludes them from ~everywhere-but-sal or whatever.

        Hey ho,

                Michael.

-- 
michael.meeks@suse.com  <><, Pseudo Engineer, itinerant idiot


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.