Boost logo

Boost :

Subject: [boost] [Boost.Log] SimpleEventLog configuration
From: Pieter (PieterB_at_[hidden])
Date: 2013-08-26 16:58:56


LS,

 

I am currently configuring my logging configuration using a property tree.
When I include a simple_event_log_backend sink, it does not seem possible
(yet) to configure an event type mapping to that sink from the property
tree. The source code does contain the following comment: "For now we use
only the default level mapping. Will add support for configuration later."

so I guess my first question would be whether such support is indeed in the
works?

 

My second question would be whether it is possible to add such a mapping
after the sink was created and added to the core.

In the documentation an example is given where the mapping is done before
the sink is added to the core:

 

typedef sinks::synchronous_sink< sinks::simple_event_log_backend > sink_t;

boost::shared_ptr< sink_t > sink(new sink_t());

sinks::event_log::custom_event_type_mapping< severity_level >
mapping("Severity");

// . define mapping here .

sink->locked_backend()->set_event_type_mapper(mapping);

// Add the sink to the core

logging::core::get()->add_sink(sink);

 

but in the case at hand adding the sink happens behind the scenes when using
the configuration utilities. It seems to me that there is no easy way to
manipulate the sink in any way once it is added to the core (unless as in
the example the shared_ptr to the sink is kept to access the sink maybe). Is
this correct?

 

Many thanks,

Pieter

 

P.s. BTW, in the section "Simplified library initialization tools" of the
documentation Table 1.15 seems to miss a 'Format' parameter that I assume
is still needed?

 


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