Constructors.
186
187 QuantLib::ext::shared_ptr<lsinks::text_ostream_backend> backend = QuantLib::ext::make_shared<lsinks::text_ostream_backend>();
188
189
190 QuantLib::ext::shared_ptr<text_sink> sink(
new text_sink(backend));
192
193
194 auto formatter = [this](const logging::record_view& rec, logging::formatting_ostream& strm) {
195 const string& msg = rec[lexpr::smessage]->c_str();
196
197
200
202
203 oreSeverity logSeverity = boost::log::extract<oreSeverity>(severity.get_name(), rec).get();
204
206
207 lsrc::severity_logger_mt<oreSeverity> lg;
208 lg.add_attribute(messageType.get_name(), lattr::constant<string>(
name));
209 BOOST_LOG_SEV(lg, logSeverity) << rec[lexpr::smessage];
210 }
211
212
214 }
215 };
216 sink->set_formatter(formatter);
217 logging::core::get()->add_sink(sink);
219}
IndependentLogger(const std::string &name)
Constructor.
std::vector< std::string > & messages()
static const std::string name
the name "StructuredLogger"
const QuantLib::ext::shared_ptr< file_sink > & fileSink()
QuantLib::ext::shared_ptr< text_sink > cacheSink_
static constexpr const char * name
boost::log::sinks::synchronous_sink< boost::log::sinks::text_ostream_backend > text_sink