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 | List of all members
lsst.ctrl.events::EventFormatter Class Reference

class that send a LogRecord into an event stream More...

#include <EventFormatter.h>

Inheritance diagram for lsst.ctrl.events::EventFormatter:
lsst::pex::logging::LogFormatter

Public Member Functions

 EventFormatter ()
 
virtual ~EventFormatter ()
 
void write (ostream *os, const pexLogging::LogRecord &rec)
 writes a record to the event log stream. This ignores the ostream, but this is required because of the signature of this required method More...
 
- Public Member Functions inherited from lsst::pex::logging::LogFormatter
 LogFormatter ()
 
 LogFormatter (const LogFormatter &that)
 
virtual ~LogFormatter ()
 
LogFormatteroperator= (const LogFormatter &that)
 

Detailed Description

class that send a LogRecord into an event stream

Definition at line 58 of file EventFormatter.h.

Constructor & Destructor Documentation

lsst.ctrl.events::EventFormatter::EventFormatter ( )
inlineexplicit

Definition at line 60 of file EventFormatter.h.

an abstract class for formatting log records into a text stream.
Definition: LogFormatter.h:73
lsst.ctrl.events::EventFormatter::~EventFormatter ( )
virtual

Definition at line 54 of file EventFormatter.cc.

54 {}

Member Function Documentation

void lsst.ctrl.events::EventFormatter::write ( ostream *  os,
const pexLogging::LogRecord rec 
)
virtual

writes a record to the event log stream. This ignores the ostream, but this is required because of the signature of this required method

Parameters
osoutput stream. this is ignored, since the output stream is the event stream; it's a placeholder because of the signature of this method.
recthe LogRecord to send to the event topic;

Implements lsst::pex::logging::LogFormatter.

Definition at line 65 of file EventFormatter.cc.

65  {
66  EventSystem system = EventSystem::getDefaultEventSystem();
67 
68  const PropertySet& ps = rec.getProperties();
69 
70  if (!ps.exists(Event::RUNID)) {
71  LogEvent event("unspecified",rec);
72  system.publishEvent(EventLog::LOGGING_TOPIC, event);
73  return;
74  }
75  std::string runid = ps.get<std::string>(Event::RUNID);
77  PipelineLogEvent event(runid,rec);
78  system.publishEvent(EventLog::LOGGING_TOPIC, event);
79  } else {
80  LogEvent event(runid,rec);
81  system.publishEvent(EventLog::LOGGING_TOPIC, event);
82  }
83 }
static EventSystem & getDefaultEventSystem()
return the default EventSystem object, which can access all previously created Transmitters and recei...
Definition: EventSystem.cc:80
static const std::string SLICEID
static const std::string LOGGING_TOPIC
Definition: EventLog.h:60
T get(std::string const &name) const
Definition: PropertySet.cc:246
Class for storing generic metadata.
Definition: PropertySet.h:82
static const std::string RUNID
Definition: Event.h:74
const lsst::daf::base::PropertySet & getProperties() const
Definition: LogRecord.h:209
bool exists(std::string const &name) const
Definition: PropertySet.cc:190

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