MIRA
Public Member Functions | Protected Attributes | List of all members
LogSink Class Referenceabstract

Abstract base class for all log sinks. More...

#include <error/LoggingCore.h>

Inheritance diagram for LogSink:
Inheritance graph
[legend]

Public Member Functions

virtual ~LogSink ()
 Destructor. More...
 
void aboutToConsume (const LogRecord &record)
 Is called by LogCore singleton whenever a new log record is written. More...
 
virtual void consume (const LogRecord &record)=0
 Overwrite this in derived class. More...
 
void resetFilter ()
 Resets the log filter. More...
 
template<typename T >
LogFilterPtr setFilter (const T &filter)
 Set the filter. More...
 
void resetFormatter ()
 Resets the formatter. More...
 
template<typename T >
LogFormatterPtr setFormatter (const T &formatter)
 Set the formatter. More...
 

Protected Attributes

LogFormatterPtr mFormatter
 
LogFilterPtr mFilter
 

Detailed Description

Abstract base class for all log sinks.

Constructor & Destructor Documentation

◆ ~LogSink()

virtual ~LogSink ( )
inlinevirtual

Destructor.

Member Function Documentation

◆ aboutToConsume()

void aboutToConsume ( const LogRecord &  record)

Is called by LogCore singleton whenever a new log record is written.

Parameters
recordThe log entry.

◆ consume()

virtual void consume ( const LogRecord &  record)
pure virtual

Overwrite this in derived class.

Is called for each log entry that passes the filter (if any)

Parameters
recordThe log entry.

Implemented in LogFileSink, LogConsoleSink, and LogTxtStreamSink.

◆ resetFilter()

void resetFilter ( )
inline

Resets the log filter.

No filter will be used to filter log entries.

◆ setFilter()

LogFilterPtr setFilter ( const T &  filter)
inline

Set the filter.

The filter must be copy constructible since we are creating a copy and inherited from LogFilterBase.

Parameters
filterThe filter object

◆ resetFormatter()

void resetFormatter ( )
inline

Resets the formatter.

No formatter will be used to format log entries.

◆ setFormatter()

LogFormatterPtr setFormatter ( const T &  formatter)
inline

Set the formatter.

The formatter must be copy constructible since we are creating a copy and inherited from LogFormatterBase.

Parameters
formatterThe formatter object

Member Data Documentation

◆ mFormatter

LogFormatterPtr mFormatter
protected

◆ mFilter

LogFilterPtr mFilter
protected

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