LRAUV  revA
LogEngine.h
Go to the documentation of this file.
1 
38 #ifndef _LOGENGINE_H
39 #define _LOGENGINE_H
40 
41 #include "LogAssociation.h"
42 #include "LogWriter.h"
43 #include "LogQueue.h"
44 #include "LoggerRules.h"
45 #include "utils/Mutex.h"
46 
47 // Foward declarations
48 class LogAssociation;
49 class Rule;
50 
63 class LogEngine
64 {
65 
66 public:
68  LogEngine();
69 
71  LogEngine( LogQueue& queue );
72 
74  virtual ~LogEngine();
75 
77  virtual void resetInputs();
78 
80  virtual void initialize( void );
81 
83  void processEntry( LogEntry* thisEntry );
84 
87  void processQueue( const Timespan& timeout );
88 
90  virtual void uninitialize( void );
91 
93  virtual LogAssociation* addAssociation( LogWriter* writer, Rule* rule );
94 
96  virtual void removeAssociation( LogWriter* writer );
97 
99  void configAssociatedLogWriters( Logger& sysLogger );
100 
103  {
104  mutex_.lock();
105  }
106 
109  {
110  mutex_.unlock();
111  }
112 
113 
114 protected:
115 
118 
121 
123  void cleanupAll( void );
124 
127 
128 };
129 
130 #endif // LOGENGINE_H
Client-side interface for injecting log data into the log queue.
Definition: Logger.h:30
void cleanupAll(void)
Definition: LogEngine.cpp:116
Contains the LogQueue class definition.
Base class for a generalized set of "log data destinations," including to files (text or binary)...
Definition: LogWriter.h:25
Contains the LogWriter class definition.
Contains the various /ref logging Rule class definitions that are used by LogEngine to determine whic...
void unlockProcessing()
Continue processing.
Definition: LogEngine.h:108
int unlock()
Unlock the mutex.
Definition: Mutex.cpp:51
LoggerAssociationDeque associations_
Stores all of the associations as a list.
Definition: LogEngine.h:126
virtual void removeAssociation(LogWriter *writer)
Remove an entry from the LoggerAssociations table.
Definition: LogEngine.cpp:131
A simple pthread Mutex abstraction.
Definition: Mutex.h:20
Timespan class, represents a delta of time.
Definition: Timestamp.h:248
Mutex mutex_
Allows the supervisor to shut down log processing.
Definition: LogEngine.h:120
virtual void initialize(void)
Initialize the component.
Definition: LogEngine.cpp:44
One "entry" in a LogQueue.
Definition: LogEntry.h:33
LogQueue & queue_
For convenience, more than anything else.
Definition: LogEngine.h:117
Stores all of the associations as a list.
Definition: LogAssociation.h:71
virtual void uninitialize(void)
Deinitialize the component.
Definition: LogEngine.cpp:93
void processEntry(LogEntry *thisEntry)
Deal with an entry as appropriate.
Definition: LogEngine.cpp:48
void lockProcessing()
Stop processing.
Definition: LogEngine.h:102
virtual void resetInputs()
Reset cached input settings associated with LogWriters.
Definition: LogEngine.cpp:34
Component responsible for handling the contents of the LogQueue.
Definition: LogEngine.h:63
Handles one mapping between a set of log entry criteria and an LogWriter.
Definition: LogAssociation.h:19
Abstract base class for classes that are used by LogEngine to determine which LogWriter(s) to use for...
Definition: LoggerRules.h:26
virtual LogAssociation * addAssociation(LogWriter *writer, Rule *rule)
Add an entry to the LoggerAssociations table.
Definition: LogEngine.cpp:125
Contains the Mutex, ThreadCondition, and MutexLocker class declarations.
void processQueue(const Timespan &timeout)
Pop log entries from the queue and deal with them as appropriate.
Definition: LogEngine.cpp:59
void configAssociatedLogWriters(Logger &sysLogger)
Configure logWriters.
Definition: LogEngine.cpp:137
Singleton wrapper for queue.
Definition: LogQueue.h:24
int lock()
Lock the mutex.
Definition: Mutex.cpp:34
virtual ~LogEngine()
Destructor for Logger.
Definition: LogEngine.cpp:28
LogEngine()
Constructor for Logger.
Definition: LogEngine.cpp:15