FACT++  1.0
int DataLogger::Write ( const Time time,
const std::string &  txt,
int  qos = kMessage 
)
virtual

Overwritten write function. This way we directly log the datalogger's messages, without going through dim's dns, thus increasing robustness.

Parameters
timesee MessageImp class param
txtsee MessageImp class param
qossee MessageImp class param
Returns
see MessageImp class param

Reimplemented from MessageImp.

Definition at line 488 of file datalogger.cc.

References qos, str, MessageImp::Write(), and StateMachineDim::Write().

489 {
490  ostringstream ss;
491  ss << "datalogger: " << txt;
492  if (fNightlyLogFile.is_open())
493  {
494  fNightlyLogImp.Write(time, ss.str(), qos);
495  }
496  else if (shouldBackLog)
497  {
498  ostringstream str;
499  MessageImp mimp(str);
500  mimp.Write(time, ss.str(), qos);
501  backLogBuffer.push_back(str.str());
502  }
503  return StateMachineDim::Write(time, ss.str(), qos);
504 }
The base implementation of a distributed messaging system.
Definition: MessageImp.h:10
ofstream fNightlyLogFile
ofstream for the NightlyLogfile
Definition: datalogger.cc:203
char str[80]
Definition: test_client.c:7
bool shouldBackLog
Definition: datalogger.cc:392
virtual int Write(const Time &time, const std::string &txt, int qos=kMessage)
Definition: MessageImp.cc:133
uint16_t qos
Definition: HeadersGPS.h:29
int Write(const Time &time, const std::string &txt, int qos=kMessage)
Redirect our own logging to fLog.
vector< string > backLogBuffer
Definition: datalogger.cc:391
MessageImp fNightlyLogImp
Log stream to fNightlyLogFile.
Definition: datalogger.cc:205

+ Here is the call graph for this function: