LRAUV  revA
Logger.h
Go to the documentation of this file.
1 
10 #ifndef LOGGER_H_
11 #define LOGGER_H_
12 
13 #include "component/FailureMode.h"
14 #include "logger/Syslog.h"
15 #include "utils/CodedStr.h"
16 #include "utils/Timestamp.h"
17 
18 class Component;
19 class DataAccessor;
20 class DataElement;
21 class LogEntry;
22 
30 class Logger
31 {
32 
33  friend class Slate;
34 
35 public:
36 
38  {
41  };
42 
44  Logger( const char *facilityIn );
45 
47  Logger( const Str &facilityIn );
48 
50  virtual ~Logger();
51 
53  void log( LogEntry *entry );
54 
56  void syslog( const char *msg, Syslog::Severity sev = Syslog::DEBUG );
57 
59  void syslog( const char *msgA, const char *msgB, Syslog::Severity sev = Syslog::DEBUG );
60 
62  void syslog( const char *msg, const size_t intMsg, Syslog::Severity sev = Syslog::DEBUG );
63 
65  void syslog( const char *msg, const int intMsg, Syslog::Severity sev = Syslog::DEBUG );
66 
68  void syslog( const char *msg, const double doubleMsg, Syslog::Severity sev = Syslog::DEBUG );
69 
71  void syslog( const Str &msg, Syslog::Severity sev = Syslog::DEBUG );
72 
74  void logSetAccuracy( Component* component, DataElement* dataElement );
75 
77  void logComponentLoad( Component* component, const bool loaded );
78 
80  void logComponentRun( Component* component, const short loop );
81 
83  void logComponentFailure( Component* component,
84  const FailureMode::FailType failure, const int failCount );
85 
87  void logData( DataAccessor& accessor, bool changed );
88 
89  const CodedStr& getFacility() const
90  {
91  return facility_;
92  }
93 
95  {
97  }
98 
99 private:
100 
102  Logger( const CodedStr* facilityIn );
103 
105 
107 
108  friend class CBIT;
109 
111  {
112  CriticalErrorReceived_ = Timestamp::NOT_SET_TIME;
113  }
114 };
115 
116 #endif /*LOGGER_H_*/
Client-side interface for injecting log data into the log queue.
Definition: Logger.h:30
virtual ~Logger()
Destructor.
Definition: Logger.cpp:46
Definition: Logger.h:39
const CodedStr & facility_
Definition: Logger.h:104
static Timestamp & LastCriticalErrorReceived()
Definition: Logger.h:94
void log(LogEntry *entry)
The generic "put this entry in the queue".
Definition: Logger.cpp:50
const CodedStr & getFacility() const
Definition: Logger.h:89
Contains the Syslog class definition.
void logData(DataAccessor &accessor, bool changed)
Create a new DataEntry.
Definition: Logger.cpp:133
One "entry" in a LogQueue.
Definition: LogEntry.h:33
Extends the Str class, adding an unsigned short code (actually, the codes are limited to 14 bits...
Definition: CodedStr.h:23
FailType
Components can fail in a variety of ways.
Definition: FailureMode.h:19
static const Timestamp NOT_SET_TIME
Constant value to represent "no time".
Definition: Timestamp.h:37
void logComponentLoad(Component *component, const bool loaded)
Create a new EventEntry for a Component load/unload.
Definition: Logger.cpp:115
void logComponentRun(Component *component, const short loop)
Create a new EventEntry for a (Mission)Component run.
Definition: Logger.cpp:121
Abstact base class of all elements which can write to, or read from the slate.
Definition: DataAccessor.h:29
Replacement for standard template class string.
Definition: Str.h:12
Definition: Syslog.h:29
void syslog(const char *msg, Syslog::Severity sev=Syslog::DEBUG)
Create a syslog entry, push into queue, C char* version.
Definition: Logger.cpp:67
static Timestamp CriticalErrorReceived_
Definition: Logger.h:106
Abstract Base class for software components.
Definition: Component.h:53
TimePrecisionType
Definition: Logger.h:37
Code unit that represents the slate.
Definition: Slate.h:73
Contains the CodedStr class declaration.
Logger(const char *facilityIn)
Constructor.
Definition: Logger.cpp:28
static void ClearCrtiticalErrorReceived()
Definition: Logger.h:110
Contains the FailureMode class definition.
Severity
An attempt to define different levels of syslog severity.
Definition: Syslog.h:28
Contains the Timestamp and Timespan class declarations.
Definition: Logger.h:40
void logComponentFailure(Component *component, const FailureMode::FailType failure, const int failCount)
Create a new EventEntry for a Component failure.
Definition: Logger.cpp:127
void logSetAccuracy(Component *component, DataElement *dataElement)
Create a new EventEntry for setting a DataElement's accuracy.
Definition: Logger.cpp:109
Represents absolute times.
Definition: Timestamp.h:31
Abstact base class for one "element" of the Slate.
Definition: DataElement.h:37
The CBIT built-in-test (CBIT) component provides monitoring of vehicle health during a mission...
Definition: CBIT.h:38