CARMA C++
LogProcessor.h
Go to the documentation of this file.
1 #ifndef CARMA_DBMS_LOGPROCESSOR_H
2 #define CARMA_DBMS_LOGPROCESSOR_H
6 #include "carma/dbms/SyslogMessage.h"
7 #include "carma/util/Logger.h"
8 #include "carma/util/Time.h"
9 #include <iostream>
10 #include <fstream>
11 #include <string>
12 #include <vector>
13 #include <sys/types.h>
14 #include <unistd.h>
21 namespace carma
22 {
23  namespace dbms
24  {
25 
28  class LogProcessor
29  {
30 
31  public:
32 
38  LogProcessor();
39 
41  virtual ~LogProcessor();
42 
43  static SyslogMessage *fromString( std::string *aMessage );
44  static SyslogMessage *fromMMAP( SyslogMMAPFile &smapf, unsigned char *ptr );
45 
46  static void decomposeSyslogMessage( std::string *aMessage,
47  SyslogMessage *bMessage );
48  static void getHostBounds(std::string *fullMessage, int &start, int &end );
49 
50 
51 
52  private:
56  enum LOGTABLECOLUMNS {
57  CALLER_COL, // the caller of the log message as well as info
58  // from syslog.
59  FRAME_COL, // input - current year in local timezone
60  // ouput - the frame count
61  PRIORITY_COL, // message priority
62  LOGNAME_COL, // logname (i.e. program name or object)
63  NDC_COL, // next diagnostic context
64  MESSAGE_COL, // the log message
65  NUM_LOGTABLE_COLS // number of columns in the table always last
66  } ;
67  };
68  }
69 }
70 
71 #endif // CARMA_DBMS_LOGPROCESSOR_H
Common time functions.
LogRecordSelector class.