#include <ored/utilities/log.hpp>
|
| | ProgressMessage (const std::string &, const QuantLib::Size, const QuantLib::Size, const std::string &detail="") |
| |
| std::string | msg () const |
| | return a std::string for the log file More...
|
| |
| void | emitLog () const |
| | generate Boost log record to pass to corresponding sinks More...
|
| |
| virtual | ~JSONMessage () |
| |
| virtual std::string | msg () const =0 |
| | return a std::string for the log file More...
|
| |
| void | log () const |
| | generate Boost log record to pass to corresponding sinks More...
|
| |
| const std::string | json () const |
| | create JSON-like output from the data More...
|
| |
| void | set (const std::string &key, const boost::any &value) |
| |
|
| static constexpr const char * | name = "ProgressMessage" |
| |
|
| virtual void | emitLog () const =0 |
| | generate Boost log record - this method is called by log() More...
|
| |
| static std::string | jsonify (const boost::any &) |
| |
| std::map< std::string, boost::any > | data_ |
| |
Definition at line 732 of file log.hpp.
◆ ProgressMessage()
| ProgressMessage |
( |
const std::string & |
, |
|
|
const QuantLib::Size |
, |
|
|
const QuantLib::Size |
, |
|
|
const std::string & |
detail = "" |
|
) |
| |
Definition at line 629 of file log.cpp.
629 {
631 if (!detail.empty())
632 data_[
"detail"] = detail;
633 data_[
"progress"] = progressCurrent;
634 data_[
"total"] = progressTotal;
635 data_[
"@timestamp"] =
636 boost::posix_time::to_iso_extended_string(boost::posix_time::microsec_clock::universal_time());
637}
std::map< std::string, boost::any > data_
◆ msg()
| std::string msg |
( |
| ) |
const |
|
virtual |
return a std::string for the log file
Implements JSONMessage.
Definition at line 739 of file log.hpp.
739{
return std::string(
name) + std::string(
" ") +
json(); }
const std::string json() const
create JSON-like output from the data
static constexpr const char * name
◆ emitLog()
generate Boost log record to pass to corresponding sinks
Implements JSONMessage.
Definition at line 639 of file log.cpp.
639 {
640 lsrc::severity_logger_mt<oreSeverity> lg;
641 lg.add_attribute(messageType.get_name(), lattr::constant<string>(
name));
642 BOOST_LOG_SEV(lg, oreSeverity::notice) <<
json();
643}
◆ name
| constexpr const char* name = "ProgressMessage" |
|
staticconstexpr |