Fawkes API  Fawkes Development Version
fawkes::SyslogLogger Class Reference

Interface for logging to syslog. More...

#include <>>

Inheritance diagram for fawkes::SyslogLogger:

List of all members.

Public Member Functions

 SyslogLogger (LogLevel log_level=LL_DEBUG)
 Constructor.
 SyslogLogger (const char *ident, LogLevel log_level=LL_DEBUG)
 Constructor with ident.
virtual ~SyslogLogger ()
 Destructor.
virtual void log_debug (const char *component, const char *format,...)
 Log debug message.
virtual void log_info (const char *component, const char *format,...)
 Log informational message.
virtual void log_warn (const char *component, const char *format,...)
 Log warning message.
virtual void log_error (const char *component, const char *format,...)
 Log error message.
virtual void vlog_debug (const char *component, const char *format, va_list va)
 Log debug message.
virtual void vlog_info (const char *component, const char *format, va_list va)
 Log informational message.
virtual void vlog_warn (const char *component, const char *format, va_list va)
 Log warning message.
virtual void vlog_error (const char *component, const char *format, va_list va)
 Log error message.
virtual void log_debug (const char *component, Exception &e)
 Log debug exception.
virtual void log_info (const char *component, Exception &e)
 Log informational exception.
virtual void log_warn (const char *component, Exception &e)
 Log warning exception.
virtual void log_error (const char *component, Exception &e)
 Log error exception.
virtual void tlog_debug (struct timeval *t, const char *component, const char *format,...)
 Log debug message for specific time.
virtual void tlog_info (struct timeval *t, const char *component, const char *format,...)
 Log informational message for specific time.
virtual void tlog_warn (struct timeval *t, const char *component, const char *format,...)
 Log warning message for specific time.
virtual void tlog_error (struct timeval *t, const char *component, const char *format,...)
 Log error message for specific time.
virtual void tlog_debug (struct timeval *t, const char *component, Exception &e)
 Log debug exception for specific time.
virtual void tlog_info (struct timeval *t, const char *component, Exception &e)
 Log informational exception for specific time.
virtual void tlog_warn (struct timeval *t, const char *component, Exception &e)
 Log warning exception for specific time.
virtual void tlog_error (struct timeval *t, const char *component, Exception &e)
 Log error exception for specific time.
virtual void vtlog_debug (struct timeval *t, const char *component, const char *format, va_list va)
 Log debug message for specific time.
virtual void vtlog_info (struct timeval *t, const char *component, const char *format, va_list va)
 Log informational message for specific time.
virtual void vtlog_warn (struct timeval *t, const char *component, const char *format, va_list va)
 Log warning message for specific time.
virtual void vtlog_error (struct timeval *t, const char *component, const char *format, va_list va)
 Log error message for specific time.

Detailed Description

Interface for logging to syslog.

The SyslogLogger will pipe all output to the syslog.

Author:
Tim Niemueller

Constructor & Destructor Documentation

fawkes::SyslogLogger::SyslogLogger ( LogLevel  log_level = LL_DEBUG)

Constructor.

Parameters:
log_levelminimum level to log

Definition at line 45 of file syslog.cpp.

fawkes::SyslogLogger::SyslogLogger ( const char *  ident,
LogLevel  log_level = LL_DEBUG 
)

Constructor with ident.

Parameters:
identident string passed to openlog.
log_levelminimum level to log

Definition at line 59 of file syslog.cpp.

fawkes::SyslogLogger::~SyslogLogger ( ) [virtual]

Destructor.

Definition at line 75 of file syslog.cpp.


Member Function Documentation

void fawkes::SyslogLogger::log_debug ( const char *  component,
const char *  format,
  ... 
) [virtual]

Log debug message.

Parameters:
componentcomponent, used to distuinguish logged messages
formatformat of the message, see man page of sprintf for available tokens.

Implements fawkes::Logger.

Definition at line 154 of file syslog.cpp.

References vlog_debug().

void fawkes::SyslogLogger::log_debug ( const char *  component,
Exception e 
) [virtual]

Log debug exception.

Parameters:
componentcomponent, used to distuinguish logged messages
eexception to log, exception messages will be logged

Implements fawkes::Logger.

Definition at line 194 of file syslog.cpp.

References fawkes::Logger::LL_DEBUG, fawkes::Mutex::lock(), fawkes::Exception::begin(), fawkes::Exception::end(), and fawkes::Mutex::unlock().

void fawkes::SyslogLogger::log_error ( const char *  component,
const char *  format,
  ... 
) [virtual]

Log error message.

Parameters:
componentcomponent, used to distuinguish logged messages
formatformat of the message, see man page of sprintf for available tokens.

Implements fawkes::Logger.

Definition at line 184 of file syslog.cpp.

References vlog_error().

void fawkes::SyslogLogger::log_error ( const char *  component,
Exception e 
) [virtual]

Log error exception.

Parameters:
componentcomponent, used to distuinguish logged messages
eexception to log, exception messages will be logged

Implements fawkes::Logger.

Definition at line 233 of file syslog.cpp.

References fawkes::Logger::LL_DEBUG, fawkes::Mutex::lock(), fawkes::Exception::begin(), fawkes::Exception::end(), and fawkes::Mutex::unlock().

void fawkes::SyslogLogger::log_info ( const char *  component,
const char *  format,
  ... 
) [virtual]

Log informational message.

Parameters:
componentcomponent, used to distuinguish logged messages
formatformat of the message, see man page of sprintf for available tokens.

Implements fawkes::Logger.

Definition at line 164 of file syslog.cpp.

References vlog_info().

void fawkes::SyslogLogger::log_info ( const char *  component,
Exception e 
) [virtual]

Log informational exception.

Parameters:
componentcomponent, used to distuinguish logged messages
eexception to log, exception messages will be logged

Implements fawkes::Logger.

Definition at line 207 of file syslog.cpp.

References fawkes::Logger::LL_INFO, fawkes::Mutex::lock(), fawkes::Exception::begin(), fawkes::Exception::end(), and fawkes::Mutex::unlock().

void fawkes::SyslogLogger::log_warn ( const char *  component,
const char *  format,
  ... 
) [virtual]

Log warning message.

Parameters:
componentcomponent, used to distuinguish logged messages
formatformat of the message, see man page of sprintf for available tokens.

Implements fawkes::Logger.

Definition at line 174 of file syslog.cpp.

References vlog_warn().

void fawkes::SyslogLogger::log_warn ( const char *  component,
Exception e 
) [virtual]

Log warning exception.

Parameters:
componentcomponent, used to distuinguish logged messages
eexception to log, exception messages will be logged

Implements fawkes::Logger.

Definition at line 220 of file syslog.cpp.

References fawkes::Logger::LL_WARN, fawkes::Mutex::lock(), fawkes::Exception::begin(), fawkes::Exception::end(), and fawkes::Mutex::unlock().

void fawkes::SyslogLogger::tlog_debug ( struct timeval *  t,
const char *  component,
const char *  format,
  ... 
) [virtual]

Log debug message for specific time.

Parameters:
ttime for this message to log
componentcomponent, used to distuinguish logged messages
formatformat of the message, see man page of sprintf for available tokens.

Implements fawkes::Logger.

Definition at line 246 of file syslog.cpp.

References vtlog_debug().

void fawkes::SyslogLogger::tlog_debug ( struct timeval *  t,
const char *  component,
Exception e 
) [virtual]

Log debug exception for specific time.

Parameters:
ttime for this message to log
componentcomponent, used to distuinguish logged messages
eexception to log, exception messages will be logged

Implements fawkes::Logger.

Definition at line 286 of file syslog.cpp.

References fawkes::Logger::LL_DEBUG, fawkes::Mutex::lock(), fawkes::Exception::begin(), fawkes::Exception::end(), and fawkes::Mutex::unlock().

void fawkes::SyslogLogger::tlog_error ( struct timeval *  t,
const char *  component,
const char *  format,
  ... 
) [virtual]

Log error message for specific time.

Parameters:
ttime for this message to log
componentcomponent, used to distuinguish logged messages
formatformat of the message, see man page of sprintf for available tokens.

Implements fawkes::Logger.

Definition at line 276 of file syslog.cpp.

References vtlog_error().

void fawkes::SyslogLogger::tlog_error ( struct timeval *  t,
const char *  component,
Exception e 
) [virtual]

Log error exception for specific time.

Parameters:
ttime for this message to log
componentcomponent, used to distuinguish logged messages
eexception to log, exception messages will be logged

Implements fawkes::Logger.

Definition at line 331 of file syslog.cpp.

References fawkes::Logger::LL_DEBUG, fawkes::Mutex::lock(), fawkes::Exception::begin(), fawkes::Exception::end(), and fawkes::Mutex::unlock().

void fawkes::SyslogLogger::tlog_info ( struct timeval *  t,
const char *  component,
const char *  format,
  ... 
) [virtual]

Log informational message for specific time.

Parameters:
ttime for this message to log
componentcomponent, used to distuinguish logged messages
formatformat of the message, see man page of sprintf for available tokens.

Implements fawkes::Logger.

Definition at line 256 of file syslog.cpp.

References vtlog_info().

void fawkes::SyslogLogger::tlog_info ( struct timeval *  t,
const char *  component,
Exception e 
) [virtual]

Log informational exception for specific time.

Parameters:
ttime for this message to log
componentcomponent, used to distuinguish logged messages
eexception to log, exception messages will be logged

Implements fawkes::Logger.

Definition at line 301 of file syslog.cpp.

References fawkes::Logger::LL_INFO, fawkes::Mutex::lock(), fawkes::Exception::begin(), fawkes::Exception::end(), and fawkes::Mutex::unlock().

void fawkes::SyslogLogger::tlog_warn ( struct timeval *  t,
const char *  component,
const char *  format,
  ... 
) [virtual]

Log warning message for specific time.

Parameters:
ttime for this message to log
componentcomponent, used to distuinguish logged messages
formatformat of the message, see man page of sprintf for available tokens.

Implements fawkes::Logger.

Definition at line 266 of file syslog.cpp.

References vtlog_warn().

void fawkes::SyslogLogger::tlog_warn ( struct timeval *  t,
const char *  component,
Exception e 
) [virtual]

Log warning exception for specific time.

Parameters:
ttime for this message to log
componentcomponent, used to distuinguish logged messages
eexception to log, exception messages will be logged

Implements fawkes::Logger.

Definition at line 316 of file syslog.cpp.

References fawkes::Logger::LL_WARN, fawkes::Mutex::lock(), fawkes::Exception::begin(), fawkes::Exception::end(), and fawkes::Mutex::unlock().

void fawkes::SyslogLogger::vlog_debug ( const char *  component,
const char *  format,
va_list  va 
) [virtual]

Log debug message.

Parameters:
componentcomponent, used to distuinguish logged messages
formatformat of the message, see man page of sprintf for available tokens.
vavariable argument list

Implements fawkes::Logger.

Definition at line 86 of file syslog.cpp.

References fawkes::Logger::LL_DEBUG, fawkes::Mutex::lock(), and fawkes::Mutex::unlock().

Referenced by log_debug().

void fawkes::SyslogLogger::vlog_error ( const char *  component,
const char *  format,
va_list  va 
) [virtual]

Log error message.

Parameters:
componentcomponent, used to distuinguish logged messages
formatformat of the message, see man page of sprintf for available tokens.
vavariable argument list

Implements fawkes::Logger.

Definition at line 137 of file syslog.cpp.

References fawkes::Logger::LL_ERROR, fawkes::Mutex::lock(), and fawkes::Mutex::unlock().

Referenced by log_error().

void fawkes::SyslogLogger::vlog_info ( const char *  component,
const char *  format,
va_list  va 
) [virtual]

Log informational message.

Parameters:
componentcomponent, used to distuinguish logged messages
formatformat of the message, see man page of sprintf for available tokens.
vavariable argument list

Implements fawkes::Logger.

Definition at line 103 of file syslog.cpp.

References fawkes::Logger::LL_INFO, fawkes::Mutex::lock(), and fawkes::Mutex::unlock().

Referenced by log_info().

void fawkes::SyslogLogger::vlog_warn ( const char *  component,
const char *  format,
va_list  va 
) [virtual]

Log warning message.

Parameters:
componentcomponent, used to distuinguish logged messages
formatformat of the message, see man page of sprintf for available tokens.
vavariable argument list

Implements fawkes::Logger.

Definition at line 120 of file syslog.cpp.

References fawkes::Logger::LL_WARN, fawkes::Mutex::lock(), and fawkes::Mutex::unlock().

Referenced by log_warn().

void fawkes::SyslogLogger::vtlog_debug ( struct timeval *  t,
const char *  component,
const char *  format,
va_list  va 
) [virtual]

Log debug message for specific time.

Parameters:
ttime for this message to log
componentcomponent, used to distuinguish logged messages
formatformat of the message, see man page of sprintf for available tokens.
vavariable argument list

Implements fawkes::Logger.

Definition at line 348 of file syslog.cpp.

References fawkes::Logger::LL_DEBUG, fawkes::Mutex::lock(), and fawkes::Mutex::unlock().

Referenced by tlog_debug().

void fawkes::SyslogLogger::vtlog_error ( struct timeval *  t,
const char *  component,
const char *  format,
va_list  va 
) [virtual]

Log error message for specific time.

Parameters:
ttime for this message to log
componentcomponent, used to distuinguish logged messages
formatformat of the message, see man page of sprintf for available tokens.
vavariable argument list

Implements fawkes::Logger.

Definition at line 409 of file syslog.cpp.

References fawkes::Logger::LL_ERROR, fawkes::Mutex::lock(), and fawkes::Mutex::unlock().

Referenced by tlog_error().

void fawkes::SyslogLogger::vtlog_info ( struct timeval *  t,
const char *  component,
const char *  format,
va_list  va 
) [virtual]

Log informational message for specific time.

Parameters:
ttime for this message to log
componentcomponent, used to distuinguish logged messages
formatformat of the message, see man page of sprintf for available tokens.
vavariable argument list

Implements fawkes::Logger.

Definition at line 369 of file syslog.cpp.

References fawkes::Logger::LL_INFO, fawkes::Mutex::lock(), and fawkes::Mutex::unlock().

Referenced by tlog_info().

void fawkes::SyslogLogger::vtlog_warn ( struct timeval *  t,
const char *  component,
const char *  format,
va_list  va 
) [virtual]

Log warning message for specific time.

Parameters:
ttime for this message to log
componentcomponent, used to distuinguish logged messages
formatformat of the message, see man page of sprintf for available tokens.
vavariable argument list

Implements fawkes::Logger.

Definition at line 389 of file syslog.cpp.

References fawkes::Logger::LL_WARN, fawkes::Mutex::lock(), and fawkes::Mutex::unlock().

Referenced by tlog_warn().


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