Boost logo

Boost :

From: Daniel Frey (daniel.frey_at_[hidden])
Date: 2004-03-22 05:45:12


Daniel Frey wrote:
> John Torjo wrote:
>
>> totally understandable. But why the try/catch inside the macros,
>> instead of inside the ::Base::Log::log function?
>
>
> No particular reason. It just worked, so I guess no one here ever saw
> any reason to do change it. Maybe the original design was influenced by
> the existing interface of log() which accepted only one log-level, not
> two. Anyway, that's easy to change and now that I think about it, it
> seems to be a good idea to move the try/catch away from the macro to
> prevent code bloat. Thanks for the idea :)

Forget that. I now remember that there was a reason why the try/catch
must be placed in the macro: We tested the log-system itself thoroughly,
so the exception is not thrown from some bug in the log-system. Instead,
the expression passed to the macro may throw. This mean that we cannot
add the try/catch inside log(), as it is too late - the exception (if
any) is thrown when the parameters for the call are evaluated. Thus, the
try/catch must be part of the macro.

Regards, Daniel

-- 
Daniel Frey
aixigo AG - financial solutions & technology
Schloß-Rahe-Straße 15, 52072 Aachen, Germany
fon: +49 (0)241 936737-42, fax: +49 (0)241 936737-99
eMail: daniel.frey_at_[hidden], web: http://www.aixigo.de

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk