fawkes::ConsoleLogger Class Reference

Interface for logging to stderr on console. More...

#include <logging/console.h>

Inheritance diagram for fawkes::ConsoleLogger:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 ConsoleLogger (LogLevel log_level=LL_DEBUG)
 Constructor.
virtual ~ConsoleLogger ()
 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 stderr on console.

The ConsoleLogger will pipe all output to stderr on the console. The output will be color coded due to the importance of the output.

Debug output will be drawn in grey font, informational output in console default color, warnings will be printed in brown/orange and errors in red.

Definition at line 35 of file console.h.


Constructor & Destructor Documentation

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

Constructor.

Parameters:
log_level minimum level to log

Definition at line 49 of file console.cpp.

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

Destructor.

Definition at line 58 of file console.cpp.


Member Function Documentation

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

Log debug exception.

Parameters:
component component, used to distuinguish logged messages
e exception to log, exception messages will be logged

Implements fawkes::Logger.

Definition at line 174 of file console.cpp.

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

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

Log debug message.

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

Implements fawkes::Logger.

Definition at line 134 of file console.cpp.

References vlog_debug().

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

Log error exception.

Parameters:
component component, used to distuinguish logged messages
e exception to log, exception messages will be logged

Implements fawkes::Logger.

Definition at line 231 of file console.cpp.

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

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

Log error message.

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

Implements fawkes::Logger.

Definition at line 164 of file console.cpp.

References vlog_error().

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

Log informational exception.

Parameters:
component component, used to distuinguish logged messages
e exception to log, exception messages will be logged

Implements fawkes::Logger.

Definition at line 193 of file console.cpp.

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

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

Log informational message.

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

Implements fawkes::Logger.

Definition at line 144 of file console.cpp.

References vlog_info().

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

Log warning exception.

Parameters:
component component, used to distuinguish logged messages
e exception to log, exception messages will be logged

Implements fawkes::Logger.

Definition at line 212 of file console.cpp.

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

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

Log warning message.

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

Implements fawkes::Logger.

Definition at line 154 of file console.cpp.

References vlog_warn().

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

Log debug exception for specific time.

Parameters:
t time for this message to log
component component, used to distuinguish logged messages
e exception to log, exception messages will be logged

Implements fawkes::Logger.

Definition at line 290 of file console.cpp.

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

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

Log debug message for specific time.

Parameters:
t time for this message to log
component component, used to distuinguish logged messages
format format of the message, see man page of sprintf for available tokens.

Implements fawkes::Logger.

Definition at line 250 of file console.cpp.

References vtlog_debug().

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

Log error exception for specific time.

Parameters:
t time for this message to log
component component, used to distuinguish logged messages
e exception to log, exception messages will be logged

Implements fawkes::Logger.

Definition at line 341 of file console.cpp.

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

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

Log error message for specific time.

Parameters:
t time for this message to log
component component, used to distuinguish logged messages
format format of the message, see man page of sprintf for available tokens.

Implements fawkes::Logger.

Definition at line 280 of file console.cpp.

References vtlog_error().

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

Log informational exception for specific time.

Parameters:
t time for this message to log
component component, used to distuinguish logged messages
e exception to log, exception messages will be logged

Implements fawkes::Logger.

Definition at line 307 of file console.cpp.

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

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

Log informational message for specific time.

Parameters:
t time for this message to log
component component, used to distuinguish logged messages
format format of the message, see man page of sprintf for available tokens.

Implements fawkes::Logger.

Definition at line 260 of file console.cpp.

References vtlog_info().

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

Log warning exception for specific time.

Parameters:
t time for this message to log
component component, used to distuinguish logged messages
e exception to log, exception messages will be logged

Implements fawkes::Logger.

Definition at line 324 of file console.cpp.

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

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

Log warning message for specific time.

Parameters:
t time for this message to log
component component, used to distuinguish logged messages
format format of the message, see man page of sprintf for available tokens.

Implements fawkes::Logger.

Definition at line 270 of file console.cpp.

References vtlog_warn().

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

Log debug message.

Parameters:
component component, used to distuinguish logged messages
format format of the message, see man page of sprintf for available tokens.
va variable argument list

Implements fawkes::Logger.

Definition at line 66 of file console.cpp.

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

Referenced by log_debug().

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

Log error message.

Parameters:
component component, used to distuinguish logged messages
format format of the message, see man page of sprintf for available tokens.
va variable argument list

Implements fawkes::Logger.

Definition at line 117 of file console.cpp.

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

Referenced by log_error().

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

Log informational message.

Parameters:
component component, used to distuinguish logged messages
format format of the message, see man page of sprintf for available tokens.
va variable argument list

Implements fawkes::Logger.

Definition at line 83 of file console.cpp.

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

Referenced by log_info().

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

Log warning message.

Parameters:
component component, used to distuinguish logged messages
format format of the message, see man page of sprintf for available tokens.
va variable argument list

Implements fawkes::Logger.

Definition at line 100 of file console.cpp.

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

Referenced by log_warn().

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

Log debug message for specific time.

Parameters:
t time for this message to log
component component, used to distuinguish logged messages
format format of the message, see man page of sprintf for available tokens.
va variable argument list

Implements fawkes::Logger.

Definition at line 360 of file console.cpp.

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

Referenced by tlog_debug().

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

Log error message for specific time.

Parameters:
t time for this message to log
component component, used to distuinguish logged messages
format format of the message, see man page of sprintf for available tokens.
va variable argument list

Implements fawkes::Logger.

Definition at line 405 of file console.cpp.

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

Referenced by tlog_error().

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

Log informational message for specific time.

Parameters:
t time for this message to log
component component, used to distuinguish logged messages
format format of the message, see man page of sprintf for available tokens.
va variable argument list

Implements fawkes::Logger.

Definition at line 375 of file console.cpp.

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

Referenced by tlog_info().

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

Log warning message for specific time.

Parameters:
t time for this message to log
component component, used to distuinguish logged messages
format format of the message, see man page of sprintf for available tokens.
va variable argument list

Implements fawkes::Logger.

Definition at line 390 of file console.cpp.

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

Referenced by tlog_warn().


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

Generated on 1 Mar 2011 for Fawkes API by  doxygen 1.6.1