On Mon, 2011-11-21 at 14:30 +0100, Stephan Bergmann wrote:
On 11/21/2011 01:30 PM, Caolán McNamara wrote:
Practical question though, is on windows where does the output go ?
SAL_INFO/WARN just go to stderr for now. What should work to see them
even for a gui soffice.exe is to add something like 2>log.txt to the
command line.
oh, does that work ? I was labouring under the misunderstanding that we
closed those streams under windows, or something of that nature. I'm a
complete windows weenie.
assert(pFoo);
if (!pFoo)
throw catchAbleFoo("wtf");
i.e. do we have a philosophical problem with gracefully/semi-gracefully
handing should-be impossible cases ?
I think that's a perversion, and should be avoided. It the author could
not convince himself that !pFoo is not impossible (modulo bugs), then he
should use OSL_WARN instead. If however he *is* convinced that !pFoo is
impossible absent any bugs, but argues that if there *are* bugs, the
added if statement adds some sort of safety,
I have no strong feelings either way, but might as well agree now while
we can. So the plan is that asserts are for 100% can never happen
things. So that would suggest that anything which might fail for
external reasons is not a candidate for assert.
oslModule hModule= osl_loadModule( foo );
assert(hModule)
if (!hModule)
throw bar;
is wrong, because foo might not exist if some member of the lunatic
fringe deleted some .sos out of his install. Or more fairly, his distro
tried to split up packages into subpackages and mis-categorized one of
them.
In which case, we should use SAL_WARN to indicate its an unlikely and
suspicious event. So do we then consider SAL_WARNs as failures from the
perspective of e.g. the smoketest where we can argue reasonably that
we're in a controlled environment and nothing unusual should occur ?
C.
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.