TwiceAsNice  2019-02-18
Public Member Functions | Protected Member Functions | Protected Attributes | Private Attributes | List of all members
Nice::SyslogFunction Struct Reference

A logger with compatibility to the format of syslogs. More...

#include <Logger.h>

Inheritance diagram for Nice::SyslogFunction:
Inheritance graph
Collaboration diagram for Nice::SyslogFunction:
Collaboration graph

Public Member Functions

 SyslogFunction (const std::string &ident)
 Ctor: Open a new log stream. More...
 
virtual void log (const Nice::LoggerObject &o)
 Log a line compatible with the syslog format. More...
 
virtual ~SyslogFunction ()
 dtor. Closes the log stream. More...
 
 SyslogFunction (const std::string &ident)
 
virtual void log (const Nice::LoggerObject &o)
 
virtual ~SyslogFunction ()
 
- Public Member Functions inherited from Nice::LogFunctionBase
 LogFunctionBase ()
 
virtual ~LogFunctionBase ()
 
 LogFunctionBase ()
 
virtual ~LogFunctionBase ()
 

Protected Member Functions

int getSyslogLevel (const int &)
 Convert a Nice log level into one of the 5 standard system log levels. More...
 
bool isDebugOrMoreVerboseLogLevelActivated ()
 classify the current log level as debug or even more verbose. More...
 
int getSyslogLevel (const int &)
 
bool isDebugOrMoreVerboseLogLevelActivated ()
 

Protected Attributes

LogFunctionBasePtr m_previousLogFunction
 

Private Attributes

std::string m_ident
 

Additional Inherited Members

- Public Attributes inherited from Nice::LogFunctionBase
::FILE * m_file
 
- Static Public Attributes inherited from Nice::LogFunctionBase
static const char * typeStr []
 
static const char * typeStrColor []
 

Detailed Description

A logger with compatibility to the format of syslogs.


Constructor & Destructor Documentation

◆ SyslogFunction() [1/2]

Nice::SyslogFunction::SyslogFunction ( const std::string &  ident)

Ctor: Open a new log stream.


Parameters
identThe identity string that is written into each log line.

◆ ~SyslogFunction() [1/2]

Nice::SyslogFunction::~SyslogFunction ( )
virtual

dtor. Closes the log stream.

Note
overridden

◆ SyslogFunction() [2/2]

Nice::SyslogFunction::SyslogFunction ( const std::string &  ident)

◆ ~SyslogFunction() [2/2]

virtual Nice::SyslogFunction::~SyslogFunction ( )
virtual
Note
overridden

Member Function Documentation

◆ getSyslogLevel() [1/2]

int Nice::SyslogFunction::getSyslogLevel ( const int &  logLevel)
protected

Convert a Nice log level into one of the 5 standard system log levels.


Parameters
logLevelNice log level to be mapped onto system log levels.
Returns
LOG_DEBUG up to LOG_ERR.

◆ getSyslogLevel() [2/2]

int Nice::SyslogFunction::getSyslogLevel ( const int &  )
protected

◆ isDebugOrMoreVerboseLogLevelActivated() [1/2]

bool Nice::SyslogFunction::isDebugOrMoreVerboseLogLevelActivated ( )
protected

◆ isDebugOrMoreVerboseLogLevelActivated() [2/2]

bool Nice::SyslogFunction::isDebugOrMoreVerboseLogLevelActivated ( )
protected

classify the current log level as debug or even more verbose.


Returns
True if the current log level is LDEBUG or higher.

◆ log() [1/2]

virtual void Nice::SyslogFunction::log ( const Nice::LoggerObject o)
virtual
Note
overridden

Implements Nice::LogFunctionBase.

◆ log() [2/2]

void Nice::SyslogFunction::log ( const Nice::LoggerObject o)
virtual

Log a line compatible with the syslog format.

Note
overridden

Parameters
oThe information to be printed.

Implements Nice::LogFunctionBase.

Member Data Documentation

◆ m_ident

std::string Nice::SyslogFunction::m_ident
private

◆ m_previousLogFunction

LogFunctionBasePtr Nice::SyslogFunction::m_previousLogFunction
protected

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