Subject: [boost] [log] v2 beta 1 mini-review request
From: Andrey Semashev (andrey.semashev_at_[hidden])
Date: 2013-01-08 15:10:04
It's been a while since Boost.Log v1 was reviewed back in 2010. Here
is the review result:
But the time was spent for purpose as the library took substantial
changes. I've just uploaded the v2 beta 1 to the SourceForge project
SVN: svn co https://boost-log.svn.sourceforge.net/svnroot/boost-log/trunk/boost-log
I must say this is not the final release; the docs are not quite
complete (in particular, the Extending the library section has not
been updated yet) and the code may have rough edges here and there.
But it is good enough to review the changes, or the whole library if
you haven't got acquainted with v1.
The change log is quite big, you can see it here:
I'll just mention the most significant highlights here:
- Character type support unified. Log records, core, filters and most
sinks have been made character type agnostic. It is possible now to
emit log records with messages with different character types in a
single application. Character code conversion will be performed as
needed when formatting log records.
- Filters and formatters were rewritten and are now based on
Boost.Phoenix. Unified attribute value placeholders in filters and
formatters. The template expressions now reside in the common
- Added support for attribute keywords in filters and formatters.
Attribute keywords identify particular attribute values within log
records; their use significantly simplify template expressions syntax.
- Reworked attribute value extraction. In fact, the old extraction API
has been split into visitation and the new extraction APIs. In
conjunction with attribute keywords this makes extracting attribute
values very simple.
- Introduced a concept of a default sink which is used when no sinks
are registered in the logging core. The sink outputs formatted log
records to the console.
- Trivial logging now outputs to console by default. Actually, trivial
logging logs to the default sink by default.
- Asynchronous sink now supports customizing record queueing
strategies. New bounded queue strategies solve the problem of log
records piling in the queue.
- Attributes are now implemented following the pimpl pattern; it is no
longer needed to create attributes using make_shared or new. This
simplified attribute registration code.
- Channel logger now allows changing channel name after construction.
I don't plan any major changes to the code until the final release,
unless something critical comes up during the review. I will keep
updating the docs in the coming days and will request permission to
merge to Boost when done. Comments are welcome.