Boost logo

Boost Users :

Subject: [Boost-users] Boost.Log SimpleEventLog question
From: Pieter (PieterB_at_[hidden])
Date: 2013-07-13 09:28:15


LS,

 

I am currently configuring my logging configuration using a property tree.
When I include a SimpleEventLog sink, how can I apply an event type mapping
to that sink?

In the stated example this 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 adding the sink happens behind the scenes when using the configuration
utilities.

 

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?

 

Many thanks,

 

Pieter



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net