Subject: Re: [boost] [log] Comments
From: Andrey Semashev (andrey.semashev_at_[hidden])
Date: 2010-03-17 00:07:07
On 03/16/2010 11:02 PM, vicente.botet wrote:
> In addition, as the attributed are typed,
> The following has no sense to me
> attr< int>("Att").begins_with("1")
> Does this works now? What it does?
It won't compile since the attribute value type is not a string.
>>>>> Have you measured the effect? Oh, I see what you mean. I
>>>>> would have no problem if you dropped the format parameter
>>>>> of attr entirely.
>>>> But I don't want to drop it. It's quite useful.
>>> You can already use Boost.Format at the top level.
>> This feature is useful in streaming formatters.
> I think attributes must be a different entity from filters and formatters. A filter or a formatter can concerns several attributes.
They are different entities now.
> The following is an attributte or a formatted attribute.
> attr< int>("X", "%04x")
> Which is its value type int or std::string?
The result of this is a formatter, which is not an int or string. But
the formatter expects an attribute value of type int to be present in
the log record. Invoking this formatter results in the attribute value
being printed according to the "%04x" format.