Boost logo

Boost :

Subject: [boost] [log] How to set/reset a channel-specific filter
From: Andreas Huber (ahd6974-spamboostorgtrap_at_[hidden])
Date: 2010-03-16 07:26:47


Hi

We're currently reviewing Boost.Log and are wondering what is the best way
to implement channel-specific filters. More precisiely, we are currently
using the following "objects":

- 2 sinks (one to debug output window, one to file)
- several severity_channel_logger_mt objects, all declared with
BOOST_LOG_DECLARE_GLOBAL_LOGGER, each of these is guaranteed to have a
unique channel name

For each of the channels, we would like to set a filter that only applies to
records logged through the given channel. Since we can't seem to set a
filter on the logger itself, we're wondering what is the best way to
accomplish this?

It seems as though both the core as well as the sinks only accept one
filter. So, it seems we would have to a) assemble a filter expression that
includes all the channels we'd like to filter on. *Or*, we could b) add
exactly two sinks per logger object and set the desired filter on both
sinks. Of course, we'd still want to only log to one file, so the question
arises whether it is safe to have multiple sinks write to one file.

If we go with method a), we'd need a way to enumerate all global loggers. If
we go with b), we'd need a method to enumerate all the sinks in the system.
We have not found a way to accomplish any of these tasks, how do we do this?

Thanks & Regards,

-- 
Andreas Huber
When replying by private email, please remove the words spam and trap
from the address shown in the header. 

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