Boost logo

Boost :

Subject: [boost] [log] v2 Initialisation, default sink behaviour and filtering documentation
From: Mats Taraldsvik (mats.taraldsvik_at_[hidden])
Date: 2013-01-23 09:38:45


Hi,

I'm in the process of adopting a logging library, so the timing of the Boost.Log v2 "status report" - for me - could not have been better. :) This library is awesome, thank you for making it!

--
I am in the process of moving beyond the default sink now, and had some issues. I tried to add the sinks after my logger object had been default initialized, and this caused some problems (partial streams/corruption, mostly). Currently I'm calling core->remove_all_sinks() to remove the default sink. Are there any "best practices" here? Perhaps it would be a good idea to add these "requirements" to the documentation, if they are not there already and I missed them? :)
--
I also noticed that the severity filter examples are :
logging::core::get()->set_filter
    (
        logging::trivial::severity >= logging::trivial::info
    );
>From "Setting up sinks", and
sink->set_filter(expr::attr< int >("Severity") >= 2);
(i.e. comparing the Severity with an int) when moving to the more advanced section in "Sink frontends".
Could you adjust one of the examples in "Sink frontends" to use the severity_level type (that the documentation introduces in the tutorial "Adding more information to log: Attributes") directly? For example:
sink->set_filter(expr::attr< severity_level  >("Severity") >= warning);
Or explaining this in "Log record formatting".
I had trouble understanding this at first, but I might be the only one :). Thought I'd mention it anyway.
--
Regards,
Mats Taraldsvik
Norkart AS
norkart.no

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