Boost logo

Boost :

From: Caleb Epstein (caleb.epstein_at_[hidden])
Date: 2004-10-22 08:49:09


On Fri, 22 Oct 2004 12:38:03 +0200, Francis ANDRE
<francis.andre_at_[hidden]> wrote:
> I am wondering what is the logging facility recommended by the boost
> community: We are using log4cpp and are quite satified for now of its functionnalities.
> But as usual, it is a separate package, not anymore maintained and
> out of the boost foundry...

I too would love to see a boost logging framework. We're using
log4cplusplus here (different implementation than log4cpp but similar
structure derived from log4j) and it has some nice features but some
warts as well.

Anyone interested in working on such a beast? It should be reasonably
simple to write something with the new Boost.Iostreams facilities that
have been reviewed recently. The must-have features for me are:

* Uses iostreams
* Thread-safe (e.g. two threads can't have their output intermixed in
the output file/stream/whatever like they would with simple ostream<<
operators)
* Multiple possible output media (files, sockets, syslog, Windows
event log, etc)
* Multiple named channels each with configurable "threshold" (e.g.
error, warning, debug, etc)
* Messages which won't be logged shouldn't even go through the
formatting step. I'm pretty sure this cannot be done in a single call
w/o macros though. For example:

    BOOST_LOG (boost::log::debug, "This is a debug message: " <<
some_expensive_to_stream_class);

Which would expand to something like:

    if (boost::log::is_enabled_for (boost::log::debug)) {
        ostringstream __os; os << "This is a debug message: " <<
some_expensive_to_stream_class;
        boost::log::force_write (boost::log::debug, os.str ());
    }

Anyone interested in working on this?

-- 
Caleb Epstein
caleb.epstein_at_[hidden]

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