Boost logo

Boost :

Subject: Re: [boost] [log] Boost.Log Formal Review
From: vicente.botet (vicente.botet_at_[hidden])
Date: 2010-03-17 18:07:31


----- Original Message -----
From: "Andrey Semashev" <andrey.semashev_at_[hidden]>
To: <boost_at_[hidden]>
Sent: Wednesday, March 17, 2010 10:50 PM
Subject: Re: [boost] [log] Boost.Log Formal Review

>
> On 03/18/2010 12:37 AM, vicente.botet wrote:
>>
>>>> maybe
>>>>
>>>> #if defined (LOG_NTRACE)
>>>> #define LOG_TRACE(logger, stream) if (true); else logger
>>>> #else
>>>> #define LOG_TRACE(logger, stream) BOOST_LOG_SEV(logger, trace)<< stream;
>>>> #endif
>>>>
>>>> I would like all the BOOST_LOG logger macros works this way.
>>>
>>> That still leaves the streaming statements compiled. Although they will
>>> likely be optimized away, this doesn't eliminate the compilation cost
>>> and does not guarantee that no other traces of logging are left (such as
>>> string constants or functions).
>>
>> I think that we need to solve two issues when log is not needed.
>> 1st : no time at all spent at runtime if log is not needed.
>> 2nd : reduce the compilation time to a minimum log is not needed.
>>
>> The first is mandatory, the second is nice to have.
>
> One of the first reasons for this request was to remove any trace of
> logging from the resulting binary (e.g., for security reasons). This
> includes the things I mentioned.

You lost me. Could you clarify which security reasons are you talking about?
I expect the compiler after compiling the expression will not generate any code associated to

if (true); else .....

Vicente


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