Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
Public Member Functions | Static Public Attributes | List of all members
ProgressMessage Class Reference

#include <ored/utilities/log.hpp>

+ Inheritance diagram for ProgressMessage:
+ Collaboration diagram for ProgressMessage:

Public Member Functions

 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...
 
- Public Member Functions inherited from JSONMessage
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 Public Attributes

static constexpr const char * name = "ProgressMessage"
 

Additional Inherited Members

virtual void emitLog () const =0
 generate Boost log record - this method is called by log() More...
 
- Static Protected Member Functions inherited from JSONMessage
static std::string jsonify (const boost::any &)
 
- Protected Attributes inherited from JSONMessage
std::map< std::string, boost::any > data_
 

Detailed Description

Definition at line 732 of file log.hpp.

Constructor & Destructor Documentation

◆ ProgressMessage()

ProgressMessage ( const std::string &  ,
const QuantLib::Size  ,
const QuantLib::Size  ,
const std::string &  detail = "" 
)

Definition at line 629 of file log.cpp.

629 {
630 data_["key"] = key;
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_
Definition: log.hpp:651

Member Function Documentation

◆ 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
Definition: log.hpp:643
static constexpr const char * name
Definition: log.hpp:736
+ Here is the call graph for this function:

◆ emitLog()

void emitLog ( ) const
virtual

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}
+ Here is the call graph for this function:

Member Data Documentation

◆ name

constexpr const char* name = "ProgressMessage"
staticconstexpr

Definition at line 736 of file log.hpp.