Boost logo

Boost :

From: John Torjo (john.lists_at_[hidden])
Date: 2005-08-05 06:26:50

> John - this is the first time I've looked at your logging library -
> looks pretty good (especially now you've got multiple levels - thats
> something I've used before, which I found very handy). I like the
> modifiers and appenders as well.

> A couple of questions -
> 1. Is it possible to associate different levels with different
> destinations (e.g. err, fatal and warn with std::cerr, others with
> std::cout)?

Not at this time. Basically, levels go like this:
- if a message's level is bigger or equal than the log's level, it's

So, I could implement something like this:
If a message's level is higher than level X, output it to some destinations.

At this time, you specify the destinations per log-hierarchy.

> 2. Is it possible to query for the current logging level? If logging
> activities take a significant amount of time, but they won't be
> output, you don't want to do them. As an example - I've written

For Boost.Log, if a message should not be outputted, logging activities
won't take place.

It's something like this:
// pseudocode
if ( !should_write_msg(log,some_level) ; else

So when you write:

BOOST_LOGL(lg,err) << "this " << "is an error" << std::endl;

is equivalent to:

if ( !should_write_msg(lg,err)) ;
else << "this " << "is an error" << std::endl;

> libraries to decode debug information (Dwarf, Stabs etc). These would
> at a high logging level, construct and output a textual equivalent of
> a debug record (which took significant time). The text construction
> wouldn't be done unless log output was going to be done.

Is this what you wanted?


John Torjo,    Contributing editor, C/C++ Users Journal
-- "Win32 GUI Generics" -- generics & GUI do mix, after all
-- -v1.6.3 (Resource Splitter)
-- - Click, Build, Run!

Boost list run by bdawes at, gregod at, cpdaniel at, john at