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.
>
Thanks!

> 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
outputted.

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 log.stream()

So when you write:

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

is equivalent to:

if ( !should_write_msg(lg,err)) ;
else lg.stream() << "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?

Best,
John

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

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