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

#include <ored/utilities/log.hpp>

+ Inheritance diagram for EventMessage:
+ Collaboration diagram for EventMessage:

Public Member Functions

 EventMessage (const std::string &msg, const std::string &msgKey, const std::map< std::string, boost::any > data={})
 
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 = "EventMessage"
 

Private Attributes

std::string message_
 

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 714 of file log.hpp.

Constructor & Destructor Documentation

◆ EventMessage()

EventMessage ( const std::string &  msg,
const std::string &  msgKey,
const std::map< std::string, boost::any >  data = {} 
)

Definition at line 716 of file log.hpp.

716 {}) {
717 data_ = data;
718 data_[msgKey] = msg;
719 }
std::string msg() const
return a std::string for the log file
Definition: log.hpp:724
std::map< std::string, boost::any > data_
Definition: log.hpp:651
@ data
Definition: log.hpp:77

Member Function Documentation

◆ msg()

std::string msg ( ) const
virtual

return a std::string for the log file

Implements JSONMessage.

Definition at line 724 of file log.hpp.

724{ return std::string(name) + std::string(" ") + json(); }
static constexpr const char * name
Definition: log.hpp:721
const std::string json() const
create JSON-like output from the data
Definition: log.hpp:643
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ emitLog()

void emitLog ( ) const
virtual

generate Boost log record to pass to corresponding sinks

Implements JSONMessage.

Definition at line 622 of file log.cpp.

622 {
623 lsrc::severity_logger_mt<oreSeverity> lg;
624 lg.add_attribute(messageType.get_name(), lattr::constant<string>(name));
625 BOOST_LOG_SEV(lg, oreSeverity::alert) << json();
626 MLOG(oreSeverity::alert, msg());
627}
#define MLOG(mask, text)
Definition: log.hpp:529
+ Here is the call graph for this function:

Member Data Documentation

◆ name

constexpr const char* name = "EventMessage"
staticconstexpr

Definition at line 721 of file log.hpp.

◆ message_

std::string message_
private

Definition at line 729 of file log.hpp.