Boost logo

Boost :

From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2008-02-12 22:57:30


AMDG

Terence Wilson wrote:
> One of the most difficult aspects of writing a logging library is not making
> users' pay for what they don't log. I've noticed that with many logging
> libraries the inclusion of logging code incurs a run-time penalty of at
> least one "if" clause per log statement even if we know at compile time that
> some or all logging is not required. This is a big deal if one wants to
> liberally sprinkle logging throughout the application.
>
> For me, a primary requirement of the logging library is that it is
> efficient. If that can be done in C++, presumably using templates and
> compile time tricks to get rid of no-ops, then I'm all for it. I'm guess I'm
> just not smart enough to figure out how to do that, maybe John is!
> Efficiency first, features second.
>

As a matter of fact, John's library uses an if statement, too. However,
if the condition is known at compile time the compiler can optimize it
away perfectly well.

In Christ,
Steven Watanabe


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