|
Boost : |
Subject: Re: [boost] [log] Boost.Log formal review closing down
From: vicente.botet (vicente.botet_at_[hidden])
Date: 2010-03-18 14:38:22
----- Original Message -----
From: "Andrey Semashev" <andrey.semashev_at_[hidden]>
To: <boost_at_[hidden]>
Sent: Thursday, March 18, 2010 6:17 PM
Subject: Re: [boost] [log] Boost.Log formal review closing down
>
> On 03/18/2010 07:51 PM, Stewart, Robert wrote:
>>
>> Vicente's corrected version:
>>
>> void
>> my_formatter(std::ostream& strm, logging::record const& rec)
>> {
>> fmt::stream<< rec.line_id()<< ":<"<< rec.severity_level()
>> << "> "<< rec.message()
>> }
>>
>> I doubt the lambda version can be clearer than that and it would certainly lead to more chances to make hard to diagnose syntax mistakes. Concerns from others about reinvention, in this case inventing your own lambda support, means that users cannot apply whatever knowledge they may have with using other lambda libraries to understanding errors in using yours. Vicente's suggested syntax is clear, simple, and permits meaningful, direct compile diagnostics. It is worth serious consideration.
>
> I agree that it is very clear, but I fail to see how it can be supported
> without hardcoding the line_id and severity_level attributes into the
> record.
I don't see any trouble the predefined attributes to be hard coded in the log record as this can improve the efficiency of the library. Do you see a problem hard coding the attributes defined by the library?
> I think that something like that could be done, however:
>
> strm << line_id(rec) << ":<" << severity_level(rec)
> << "> " << rec.message();
This is fine for me. This allows to manage with intrinsec and extrinsec attributes in the same way. But why message will be different from all other attributes?
Best,
Vicente
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk