Boost logo

Boost :

Subject: Re: [boost] [log] review part 2
From: Andrey Semashev (andrey.semashev_at_[hidden])
Date: 2010-03-24 11:58:32


On 03/24/2010 01:25 PM, Vladimir Prus wrote:
> On Tuesday 16 March 2010 18:07:55 Andrey Semashev wrote:
>
>> On 03/16/2010 01:46 AM, Steven Watanabe wrote:
>>>>>>> BOOST_LOG_ATTRIBUTE(logging::trivial::severity_level, severity);
>>>>>>> BOOST_LOG_ATTRIBUTE(unsigned int, line_id);
>>>>>>
>>>>>> I thought if that. It was not done for two reasons:
>>>>>>
>>>>>> 1. The macro would have to have a formatter in its arguments. Given
>>>>>> that the attribute definition should be exposed rather widely, this
>>>>>> additional dependency would be unwelcome.
>>>
>>> Why is it necessary to pass a formatter to the macro?
>>
>> In order to support your syntax:
>>
>> fmt::stream
>> << fmt::line_id()
>> << ":<"<< fmt::severity()
>> << "> "<< fmt::message()
>
> Steven, Andrey,
>
> did you arrive to any decision on the point above?

Well, my assertion stays valid - the macro would expose formatters to
all code that uses the attribute, and that is not desirable (especially
in light of the expressed concerns about compilation times).

There was further discussion on porting filters and formatters to
Boost.Proto. I can't tell if this would alleviate the problem, but if it
appears that it is possible not to introduce that dependency or the
dependency is ultra-light, then I will provide something like that.


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