LSSTApplications  8.0.0.0+107,8.0.0.1+13,9.1+18,9.2,master-g084aeec0a4,master-g0aced2eed8+6,master-g15627eb03c,master-g28afc54ef9,master-g3391ba5ea0,master-g3d0fb8ae5f,master-g4432ae2e89+36,master-g5c3c32f3ec+17,master-g60f1e072bb+1,master-g6a3ac32d1b,master-g76a88a4307+1,master-g7bce1f4e06+57,master-g8ff4092549+31,master-g98e65bf68e,master-ga6b77976b1+53,master-gae20e2b580+3,master-gb584cd3397+53,master-gc5448b162b+1,master-gc54cf9771d,master-gc69578ece6+1,master-gcbf758c456+22,master-gcec1da163f+63,master-gcf15f11bcc,master-gd167108223,master-gf44c96c709
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 lsst.ctrl.events::PipelineLogEvent

Public Member Functions

 LogEvent ()
 Creates LogEvent which contains a PropertySet. More...
 
 LogEvent (const std::string &runid, const pexLogging::LogRecord &rec)
 
 LogEvent (cms::TextMessage *msg)
 
virtual ~LogEvent ()
 destructor More...
 
virtual void populateHeader (cms::TextMessage *msg) const
 
int getLevel ()
 
std::string getLog ()
 
vector< std::string > getComment ()
 
- Public Member Functions inherited from lsst.ctrl.events::Event
 Event ()
 
 Event (const std::string &runid, const PropertySet::Ptr ps)
 
 Event (const std::string &runid, const PropertySet &ps)
 
 Event (cms::TextMessage *msg)
 
virtual ~Event ()
 destructor More...
 
PropertySet::Ptr getPropertySet () const
 
std::string getPubDate ()
 Get the publication date of this event. More...
 
long long getPubTime ()
 
void setPubTime (long long t)
 
long long getEventTime ()
 
void setEventTime (long long nsecs)
 
void updateEventTime ()
 
std::string getEventDate ()
 Get the creation date of this event. More...
 
std::string getHostId ()
 
std::string getRunId ()
 
std::string getType ()
 
std::string getStatus ()
 
void setStatus (std::string status)
 
void setTopic (std::string topic)
 
std::string getTopic ()
 
vector< std::string > getFilterablePropertyNames ()
 
vector< std::string > getCustomPropertyNames ()
 
PropertySet::Ptr getCustomPropertySet () const
 
void marshall (cms::TextMessage *msg)
 
 ExceptionEvent ()
 
 ExceptionEvent (const std::string &runid, const LSSTException ex)
 
 ExceptionEvent (cms::TextMessage *msg)
 
 ~LogEvent ()
 
void populateHeader (cms::TextMessage *msg)
 
std::string getExceptionType ()
 
std::string getStackTrace ()
 

Static Public Attributes

static const std::string COMMENT = "COMMENT"
 
static const std::string LEVEL = "LEVEL"
 
static const std::string LOG = "LOG"
 
- Static Public Attributes inherited from lsst.ctrl.events::Event
static const std::string TYPE = "TYPE"
 Creates Event which contains a PropertySet. More...
 
static const std::string EVENTTIME = "EVENTTIME"
 
static const std::string HOSTID = "HOSTID"
 
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"
 
static const std::string EXCEPTIONTYPE
 
static const std::string STACKTRACE
 

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 (const std::string &runid, const PropertySet &ps)
 
void splitString (std::string str, std::string delim, std::vector< std::string > &results)
 
void splitTuple (std::string str, std::string delim, std::vector< std::string > &results)
 
- Protected Attributes inherited from lsst.ctrl.events::Event
PropertySet::Ptr _psp
 
set< std::string > _keywords
 

Detailed Description

Representation of an LSST Event.

Definition at line 67 of file LogEvent.h.

Constructor & Destructor Documentation

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

Creates LogEvent which contains a PropertySet.

Definition at line 66 of file LogEvent.cc.

66  : Event() {
67  _init();
68 }
lsst.ctrl.events::LogEvent::LogEvent ( const std::string &  runid,
const pexLogging::LogRecord rec 
)

Definition at line 105 of file LogEvent.cc.

105  : Event(runId, rec.getProperties()) {
106  _init();
107 
108 
109  const PropertySet& ps = rec.getProperties();
110 
111  _psp->set(TYPE, EventTypes::LOG);
112 
113  if (!ps.exists(LogEvent::LOG))
114  _psp->set(LogEvent::LOG, "default");
115  else
117 
118  if (!ps.exists(LogEvent::LEVEL))
119  _psp->set(LogEvent::LEVEL, -1);
120  else
121  _psp->set(LogEvent::LEVEL, rec.getImportance());
122 
123 
124 
125  if (ps.exists(LogEvent::COMMENT)) {
126  std::vector<std::string> commentArray = ps.getArray<std::string>(LogEvent::COMMENT);
127 
128  _psp->set(LogEvent::COMMENT, commentArray);
129  } else {
130  _psp->set(LogEvent::COMMENT, "none|@|");
131  }
132 }
PropertySet::Ptr _psp
Definition: Event.h:117
static const std::string TYPE
Creates Event which contains a PropertySet.
Definition: Event.h:71
static const std::string LOG
Definition: EventTypes.h:47
static const std::string LEVEL
Definition: LogEvent.h:71
Class for storing generic metadata.
Definition: PropertySet.h:82
std::string getAsString(std::string const &name) const
Definition: PropertySet.cc:444
std::vector< T > getArray(std::string const &name) const
const lsst::daf::base::PropertySet & getProperties() const
Definition: LogRecord.h:209
static const std::string COMMENT
Definition: LogEvent.h:70
bool exists(std::string const &name) const
Definition: PropertySet.cc:190
static const std::string LOG
Definition: LogEvent.h:72
lsst.ctrl.events::LogEvent::LogEvent ( cms::TextMessage *  msg)

Definition at line 77 of file LogEvent.cc.

77  : Event(msg) {
78  _init();
79 
80  vector<std::string>results;
81 
82  std::string str = msg->getStringProperty(LogEvent::COMMENT);
83 
84  std::string::size_type cutAt;
85 
86  std::string::size_type delim_len = LogEvent::DELIMITER.length();
87  while( (cutAt = str.find(LogEvent::DELIMITER)) != str.npos ) {
88  if(cutAt > 0) {
89  results.push_back(str.substr(0,cutAt));
90  }
91  str = str.substr(cutAt+delim_len);
92  }
93  if(str.length() > 0) {
94  results.push_back(str);
95  }
96 
97  _psp->set(LogEvent::COMMENT, results);
98 
99  _psp->set(LogEvent::LEVEL, msg->getIntProperty(LogEvent::LEVEL));
100 
101  _psp->set(LogEvent::LOG, msg->getStringProperty(LogEvent::LOG));
102 
103 }
PropertySet::Ptr _psp
Definition: Event.h:117
static const std::string DELIMITER
Definition: LogEvent.h:88
static const std::string LEVEL
Definition: LogEvent.h:71
static const std::string COMMENT
Definition: LogEvent.h:70
static const std::string LOG
Definition: LogEvent.h:72
lsst.ctrl.events::LogEvent::~LogEvent ( )
virtual

destructor

Definition at line 166 of file LogEvent.cc.

166  {
167 }

Member Function Documentation

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

Definition at line 71 of file LogEvent.cc.

71  {
73  _keywords.insert(LogEvent::LEVEL);
74  _keywords.insert(LogEvent::LOG);
75 }
static const std::string LEVEL
Definition: LogEvent.h:71
static const std::string COMMENT
Definition: LogEvent.h:70
set< std::string > _keywords
Definition: Event.h:118
static const std::string LOG
Definition: LogEvent.h:72
std::vector< std::string > lsst.ctrl.events::LogEvent::getComment ( )

Definition at line 152 of file LogEvent.cc.

152  {
153  return _psp->getArray<std::string>(LogEvent::COMMENT);
154 }
PropertySet::Ptr _psp
Definition: Event.h:117
static const std::string COMMENT
Definition: LogEvent.h:70
int lsst.ctrl.events::LogEvent::getLevel ( )

Definition at line 156 of file LogEvent.cc.

156  {
157  return _psp->get<int>(LogEvent::LEVEL);
158 }
PropertySet::Ptr _psp
Definition: Event.h:117
static const std::string LEVEL
Definition: LogEvent.h:71
std::string lsst.ctrl.events::LogEvent::getLog ( )

Definition at line 160 of file LogEvent.cc.

160  {
161  return _psp->get<std::string>(LogEvent::LOG);
162 }
PropertySet::Ptr _psp
Definition: Event.h:117
static const std::string LOG
Definition: LogEvent.h:72
void lsst.ctrl.events::LogEvent::populateHeader ( cms::TextMessage *  msg) const
virtual

Reimplemented from lsst.ctrl.events::Event.

Reimplemented in lsst.ctrl.events::PipelineLogEvent.

Definition at line 134 of file LogEvent.cc.

134  {
136 
137  std::vector<std::string> vec = _psp->getArray<std::string>(LogEvent::COMMENT);
138  std::ostringstream comment;
139  std::vector<std::string>::iterator iter;
140  for (iter = vec.begin(); iter != vec.end(); iter++) {
141  comment << *iter << LogEvent::DELIMITER;
142  }
143 
144  msg->setStringProperty(LogEvent::COMMENT, comment.str());
145 
146  msg->setIntProperty(LogEvent::LEVEL, _psp->get<int>(LogEvent::LEVEL));
147 
148  msg->setStringProperty(LogEvent::LOG, _psp->get<std::string>(LogEvent::LOG));
149 
150 }
virtual void populateHeader(cms::TextMessage *msg) const
Definition: Event.cc:201
PropertySet::Ptr _psp
Definition: Event.h:117
int iter
static const std::string DELIMITER
Definition: LogEvent.h:88
static const std::string LEVEL
Definition: LogEvent.h:71
static const std::string COMMENT
Definition: LogEvent.h:70
static const std::string LOG
Definition: LogEvent.h:72

Member Data Documentation

const std::string lsst.ctrl.events::LogEvent::COMMENT = "COMMENT"
static

Definition at line 70 of file LogEvent.h.

const std::string lsst.ctrl.events::LogEvent::DELIMITER = "|@|"
staticprivate

Definition at line 88 of file LogEvent.h.

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

Definition at line 71 of file LogEvent.h.

const std::string lsst.ctrl.events::LogEvent::LOG = "LOG"
static

Definition at line 72 of file LogEvent.h.


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