Boost logo

Boost :

Subject: Re: [boost] [log] How to set/reset a channel-specific filter
From: Andrey Semashev (andrey.semashev_at_[hidden])
Date: 2010-03-17 00:12:36


On 03/16/2010 11:08 PM, Andreas Huber wrote:
>>> Unless I'm missing something,
>>> this would require us keeping a global list of all loggers that have a
>>> filter applied, correct?
>>
>> Unless you can work with channel names instead of loggers, yes.
>
> I don't understand, it seems even if I have the channel name (instead of
> the logger), I still need to maintain a global map that associates each
> channel name with its minimum severity level, right? Otherwise I don't
> see how I can implement is_channel_enabled.

Right, the function will need some kind of container of all enabled
channels.

> Anyway, doing this certainly is no big deal. It just seems a bit odd,
> because it would be easier and more efficient to implement if we could
> set a filter on a logger.

Loggers don't filter records, because you're not restricted to have a
single logger per channel. But if that restriction is mandated in your
application, you can implement a logger feature that would do additional
filtering inside the logger.


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