Boost logo

Boost :

From: Andrei Alexandrescu (See Website For Email) (SeeWebsiteForEmail_at_[hidden])
Date: 2005-04-25 14:30:47


John Torjo wrote:
>
>>
>> Hi. If I understand right the code, even if log is disabled, I do pay
>> for constructing
>> log messages. Am I right? If so why do you force this?
>
>
> No, you donot pay.
>
> BOOST_LOG(app) << "testing " << i << '-' << j << '-' << k;
>
> Is the equivalent of:
>
> if ( is_log_enabled(app) ) app_log() << "testing" << i ...;

Hopefully the actual expansion uses a if/else statement so as to avoid
wreaking havoc in calling code?

if ( !is_log_enabled(app) ) ; else app_log() << "testing" << i ...;

Andrei


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