Public Member Functions | Private Attributes | List of all members
nl::timing::LogFile Class Reference

#include "/cvmfs/nova-development.opensciencegrid.org/novasoft/releases/N20-09-23/Commissioning/Nearline/TimingPlots/LogFile.h"

Public Member Functions

 LogFile (std::string path)
 
 ~LogFile ()
 
void ProcessLog ()
 
std::vector< nl::timing::LogMessage * > GetMessages ()
 

Private Attributes

std::string _path
 
std::vector< nl::timing::LogMessage * > _messages
 

Detailed Description

Definition at line 21 of file LogFile.h.

Constructor & Destructor Documentation

nl::timing::LogFile::LogFile ( std::string  path)

Definition at line 16 of file LogFile.cxx.

References _path, and path.

17  {
18  _path = path;
19  }
std::string _path
Definition: LogFile.h:28
const std::string path
Definition: plot_BEN.C:43
nl::timing::LogFile::~LogFile ( )

Definition at line 22 of file LogFile.cxx.

22 {}

Member Function Documentation

std::vector<nl::timing::LogMessage*> nl::timing::LogFile::GetMessages ( )
inline

Definition at line 28 of file LogFile.h.

References _messages, and _path.

28 { return _messages; };
std::vector< nl::timing::LogMessage * > _messages
Definition: LogFile.h:32
void nl::timing::LogFile::ProcessLog ( )

Definition at line 25 of file LogFile.cxx.

References _messages, _path, om::cout, allTimeWatchdog::endl, cvn::kUnknown, make_syst_table_plots::line, runNovaSAM::logfile, lem_server::msg, and submit_cafana::regex.

26  {
27  std::ifstream logfile(_path);
28 
29  std::regex MFmsg("\\%MSG\\-i");
30 
32 
33  int COUNT = 0;
34  while (std::getline(logfile, line))
35  {
36  if(std::regex_search(line, MFmsg)) {
37  ++COUNT;
38 
39  // Check the message type
40  std::regex msgTypeSpillSent("SpillSent");
41  std::regex msgTypeTimeDrift("TimeDrift");
42 
44 
45  if (std::regex_search(line, msgTypeSpillSent)) type = LogMessage::MessageType::kSpillSent;
46  if (std::regex_search(line, msgTypeTimeDrift)) type = LogMessage::MessageType::kTimeDrift;
47 
48  std::getline(logfile, line);
49 
50  LogMessage* msg = new LogMessage(line, type);
51  this->_messages.push_back(msg);
52  }
53 
54  if (COUNT > 100) break;
55  }
56 
57  logfile.close();
58 
59  std::cout << "Processed " << COUNT << " log messages" << std::endl;
60 
61  return;
62  }
std::string _path
Definition: LogFile.h:28
std::vector< nl::timing::LogMessage * > _messages
Definition: LogFile.h:32
OStream cout
Definition: OStream.cxx:6
::xsd::cxx::tree::string< char, simple_type > string
Definition: Database.h:154

Member Data Documentation

std::vector<nl::timing::LogMessage*> nl::timing::LogFile::_messages
private

Definition at line 32 of file LogFile.h.

Referenced by GetMessages(), and ProcessLog().

std::string nl::timing::LogFile::_path
private

Definition at line 28 of file LogFile.h.

Referenced by GetMessages(), LogFile(), and ProcessLog().


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