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


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::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.
Mats Taraldsvik
Norkart AS

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