LSSTApplications  10.0-2-g4f67435,11.0.rc2+1,11.0.rc2+12,11.0.rc2+3,11.0.rc2+4,11.0.rc2+5,11.0.rc2+6,11.0.rc2+7,11.0.rc2+8
LSSTDataManagementBasePackage
Public Member Functions | Static Public Attributes | Private Member Functions | Static Private Attributes | List of all members
lsst::ctrl::events::LogEvent Class Reference

Representation of an LSST Event. More...

#include <LogEvent.h>

Inheritance diagram for lsst::ctrl::events::LogEvent:
lsst::ctrl::events::Event

Public Member Functions

 LogEvent ()
 Creates LogEvent which contains a PropertySet. More...
 
 LogEvent (log4cxx::spi::LoggingEventPtr const &event, log4cxx::helpers::Pool &p)
 
 LogEvent (cms::TextMessage *msg)
 Constructor to take a JMS TextMessage and turn it into a LogEvent. More...
 
virtual ~LogEvent ()
 destructor More...
 
virtual void populateHeader (cms::TextMessage *msg) const
 
int getLevel ()
 retreive the log level More...
 
std::string getLoggingTopic ()
 Retreive the log message. More...
 
std::string getLogger ()
 Retreive the log message. More...
 
- Public Member Functions inherited from lsst::ctrl::events::Event
 Event ()
 Constructor for Event with no properties. More...
 
 Event (PropertySet const &properties)
 Constructor for Event. More...
 
 Event (PropertySet const &properties, PropertySet const &filterable)
 Constructor for Event. More...
 
 Event (std::string const &runid, PropertySet::Ptr const properties)
 Constructor for Event. More...
 
 Event (std::string const &runid, PropertySet const &properties)
 Constructor for Event. More...
 
 Event (std::string const &runid, PropertySet const &properties, PropertySet const &filterable)
 Constructor for Event. More...
 
 Event (cms::TextMessage *msg)
 Constructor for Event. More...
 
virtual ~Event ()
 destructor More...
 
PropertySet::Ptr getPropertySet () const
 retrieve the PropertySet for this Event More...
 
std::string getPubDate ()
 get the publication date of this Event, in ASCII More...
 
long long getPubTime ()
 get the publication time of this Event More...
 
void setPubTime (long long t)
 set the publication time of this Event More...
 
long long getEventTime ()
 get the event creation time More...
 
void setEventTime (long long nsecs)
 set the event creation time More...
 
void updateEventTime ()
 update the Event time to the current time More...
 
std::string getEventDate ()
 get the Event Date More...
 
std::string getRunId ()
 get the RunId for this Event More...
 
std::string getType ()
 get the Event type More...
 
std::string getStatus ()
 get the Event status More...
 
void setStatus (std::string status)
 set the Event status More...
 
void setTopic (std::string topic)
 set the Event topic More...
 
std::string getTopic ()
 get the Event topic More...
 
vector< std::string > getFilterablePropertyNames ()
 return all filterable property names More...
 
vector< std::string > getCustomPropertyNames ()
 return all custom property names More...
 
PropertySet::Ptr getCustomPropertySet () const
 return all custom property set More...
 
void marshall (cms::TextMessage *msg)
 marshall values in this event into a cms::TextMessage More...
 

Static Public Attributes

static const std::string LEVEL = "LEVEL"
 
static const std::string LOGGER = "LOGGER"
 
static const std::string MESSAGE = "MESSAGE"
 
static const std::string TIMESTAMP = "TIMESTAMP"
 
static const std::string THREADNAME = "THREADNAME"
 
static const std::string FILENAME = "FILENAME"
 
static const std::string CLASSNAME = "CLASSNAME"
 
static const std::string METHODNAME = "METHODNAME"
 
static const std::string LINENUMBER = "LINENUMBER"
 
static const std::string LOCATION = "LOCATION"
 
static const std::string LOGGING_TOPIC = "Logging"
 
- Static Public Attributes inherited from lsst::ctrl::events::Event
static const std::string TYPE = "TYPE"
 
static const std::string EVENTTIME = "EVENTTIME"
 
static const std::string RUNID = "RUNID"
 
static const std::string STATUS = "STATUS"
 
static const std::string TOPIC = "TOPIC"
 
static const std::string PUBTIME = "PUBTIME"
 
static const std::string UNINITIALIZED = "uninitialized"
 

Private Member Functions

void _init ()
 

Static Private Attributes

static const std::string DELIMITER
 

Additional Inherited Members

- Protected Member Functions inherited from lsst::ctrl::events::Event
void _init ()
 
void _constructor (std::string const &runid, PropertySet const &properties, PropertySet const &filterable)
 
template<typename T >
void add (std::string const &name, std::string const &tag, PropertySet const &properties, boost::property_tree::ptree &child)
 
- Protected Attributes inherited from lsst::ctrl::events::Event
PropertySet::Ptr _psp
 
PropertySet::Ptr _filterable
 
set< std::string > _keywords
 

Detailed Description

Representation of an LSST Event.

Definition at line 64 of file LogEvent.h.

Constructor & Destructor Documentation

lsst::ctrl::events::LogEvent::LogEvent ( )

Creates LogEvent which contains a PropertySet.

Definition at line 79 of file LogEvent.cc.

79  : Event() {
80  _init();
81 }
Event()
Constructor for Event with no properties.
Definition: Event.cc:81
lsst::ctrl::events::LogEvent::LogEvent ( log4cxx::spi::LoggingEventPtr const &  event,
log4cxx::helpers::Pool &  p 
)

Definition at line 83 of file LogEvent.cc.

83  : Event() {
84  _init();
85 
86  _psp->set(TYPE, EventTypes::LOG);
87  _psp->set(LogEvent::LOGGER, event->getLoggerName());
88  _psp->set(LogEvent::LEVEL, event->getLevel()->toInt());
89 
90  _psp->set(LogEvent::MESSAGE, event->getMessage());
91  _psp->set(LogEvent::TIMESTAMP, event->getTimeStamp());
92  _psp->set(LogEvent::THREADNAME, event->getThreadName());
93 
94  spi::LocationInfo location = event->getLocationInformation();
95 
97  loc->set(LogEvent::FILENAME, location.getFileName());
98  loc->set(LogEvent::CLASSNAME, location.getClassName());
99  loc->set(LogEvent::METHODNAME, location.getMethodName());
100  loc->set(LogEvent::LINENUMBER, location.getLineNumber());
101 
102  _psp->set(LogEvent::LOCATION, loc);
103 }
static const std::string LEVEL
Definition: LogEvent.h:67
static const std::string TIMESTAMP
Definition: LogEvent.h:71
PropertySet::Ptr _psp
Definition: Event.h:236
boost::shared_ptr< PropertySet > Ptr
Definition: PropertySet.h:90
static const std::string METHODNAME
Definition: LogEvent.h:75
static const std::string THREADNAME
Definition: LogEvent.h:72
static const std::string LOG
Definition: EventTypes.h:47
static const std::string MESSAGE
Definition: LogEvent.h:70
static const std::string CLASSNAME
Definition: LogEvent.h:74
Event()
Constructor for Event with no properties.
Definition: Event.cc:81
static const std::string TYPE
Definition: Event.h:66
static const std::string LOGGER
Definition: LogEvent.h:68
Class for storing generic metadata.
Definition: PropertySet.h:82
static const std::string FILENAME
Definition: LogEvent.h:73
static const std::string LOCATION
Definition: LogEvent.h:77
static const std::string LINENUMBER
Definition: LogEvent.h:76
lsst::ctrl::events::LogEvent::LogEvent ( cms::TextMessage *  msg)

Constructor to take a JMS TextMessage and turn it into a LogEvent.

Parameters
msga TextMessage

Definition at line 118 of file LogEvent.cc.

118  : Event(msg) {
119  _init();
120 
121  _psp->set(LogEvent::LEVEL, msg->getIntProperty(LogEvent::LEVEL));
122  _psp->set(LogEvent::LOGGER, msg->getStringProperty(LogEvent::LOGGER));
123 
124 }
static const std::string LEVEL
Definition: LogEvent.h:67
PropertySet::Ptr _psp
Definition: Event.h:236
Event()
Constructor for Event with no properties.
Definition: Event.cc:81
static const std::string LOGGER
Definition: LogEvent.h:68
lsst::ctrl::events::LogEvent::~LogEvent ( )
virtual

destructor

Definition at line 164 of file LogEvent.cc.

164  {
165 }

Member Function Documentation

void lsst::ctrl::events::LogEvent::_init ( )
private

private method to add keywords used in LogEvent JMS headers

Definition at line 108 of file LogEvent.cc.

108  {
109  _keywords.insert(LogEvent::LEVEL);
110  _keywords.insert(LogEvent::LOGGER);
111 }
static const std::string LEVEL
Definition: LogEvent.h:67
set< std::string > _keywords
Definition: Event.h:238
static const std::string LOGGER
Definition: LogEvent.h:68
int lsst::ctrl::events::LogEvent::getLevel ( )

retreive the log level

Returns
the logging level at which the LogRecord message was set

Definition at line 141 of file LogEvent.cc.

141  {
142  return _psp->get<int>(LogEvent::LEVEL);
143 }
static const std::string LEVEL
Definition: LogEvent.h:67
PropertySet::Ptr _psp
Definition: Event.h:236
std::string lsst::ctrl::events::LogEvent::getLogger ( )

Retreive the log message.

Returns
a string containing the log message itself

Definition at line 149 of file LogEvent.cc.

149  {
150  return _psp->get<std::string>(LogEvent::LOGGER);
151 }
PropertySet::Ptr _psp
Definition: Event.h:236
static const std::string LOGGER
Definition: LogEvent.h:68
std::string lsst::ctrl::events::LogEvent::getLoggingTopic ( )

Retreive the log message.

Returns
a string containing the log message itself

Definition at line 157 of file LogEvent.cc.

157  {
159 }
static const std::string LOGGING_TOPIC
Definition: LogEvent.h:79
void lsst::ctrl::events::LogEvent::populateHeader ( cms::TextMessage *  msg) const
virtual

private method used to populate the LogEvent

Reimplemented from lsst::ctrl::events::Event.

Definition at line 129 of file LogEvent.cc.

129  {
131 
132  msg->setIntProperty(LogEvent::LEVEL, _psp->get<int>(LogEvent::LEVEL));
133  msg->setStringProperty(LogEvent::LOGGER, _psp->get<std::string>(LogEvent::LOGGER));
134 
135 }
static const std::string LEVEL
Definition: LogEvent.h:67
PropertySet::Ptr _psp
Definition: Event.h:236
virtual void populateHeader(cms::TextMessage *msg) const
populate a cms::TextMessage header with properties
Definition: Event.cc:241
static const std::string LOGGER
Definition: LogEvent.h:68

Member Data Documentation

const std::string lsst::ctrl::events::LogEvent::CLASSNAME = "CLASSNAME"
static

Definition at line 74 of file LogEvent.h.

const std::string lsst::ctrl::events::LogEvent::DELIMITER
staticprivate

Definition at line 95 of file LogEvent.h.

const std::string lsst::ctrl::events::LogEvent::FILENAME = "FILENAME"
static

Definition at line 73 of file LogEvent.h.

const std::string lsst::ctrl::events::LogEvent::LEVEL = "LEVEL"
static

Definition at line 67 of file LogEvent.h.

const std::string lsst::ctrl::events::LogEvent::LINENUMBER = "LINENUMBER"
static

Definition at line 76 of file LogEvent.h.

const std::string lsst::ctrl::events::LogEvent::LOCATION = "LOCATION"
static

Definition at line 77 of file LogEvent.h.

const std::string lsst::ctrl::events::LogEvent::LOGGER = "LOGGER"
static

Definition at line 68 of file LogEvent.h.

const std::string lsst::ctrl::events::LogEvent::LOGGING_TOPIC = "Logging"
static

Definition at line 79 of file LogEvent.h.

const std::string lsst::ctrl::events::LogEvent::MESSAGE = "MESSAGE"
static

Definition at line 70 of file LogEvent.h.

const std::string lsst::ctrl::events::LogEvent::METHODNAME = "METHODNAME"
static

Definition at line 75 of file LogEvent.h.

const std::string lsst::ctrl::events::LogEvent::THREADNAME = "THREADNAME"
static

Definition at line 72 of file LogEvent.h.

const std::string lsst::ctrl::events::LogEvent::TIMESTAMP = "TIMESTAMP"
static

Definition at line 71 of file LogEvent.h.


The documentation for this class was generated from the following files: