Fawkes API
Fawkes Development Version
|
Interface for logging to stderr. More...
#include <>>
Public Member Functions | |
ConsoleLogger (LogLevel log_level=LL_DEBUG) | |
Constructor. More... | |
virtual | ~ConsoleLogger () |
Destructor. More... | |
virtual void | log_debug (const char *component, const char *format,...) |
Log debug message. More... | |
virtual void | log_info (const char *component, const char *format,...) |
Log informational message. More... | |
virtual void | log_warn (const char *component, const char *format,...) |
Log warning message. More... | |
virtual void | log_error (const char *component, const char *format,...) |
Log error message. More... | |
virtual void | vlog_debug (const char *component, const char *format, va_list va) |
Log debug message. More... | |
virtual void | vlog_info (const char *component, const char *format, va_list va) |
Log informational message. More... | |
virtual void | vlog_warn (const char *component, const char *format, va_list va) |
Log warning message. More... | |
virtual void | vlog_error (const char *component, const char *format, va_list va) |
Log error message. More... | |
virtual void | log_debug (const char *component, Exception &e) |
Log debug exception. More... | |
virtual void | log_info (const char *component, Exception &e) |
Log informational exception. More... | |
virtual void | log_warn (const char *component, Exception &e) |
Log warning exception. More... | |
virtual void | log_error (const char *component, Exception &e) |
Log error exception. More... | |
virtual void | tlog_debug (struct timeval *t, const char *component, const char *format,...) |
Log debug message for specific time. More... | |
virtual void | tlog_info (struct timeval *t, const char *component, const char *format,...) |
Log informational message for specific time. More... | |
virtual void | tlog_warn (struct timeval *t, const char *component, const char *format,...) |
Log warning message for specific time. More... | |
virtual void | tlog_error (struct timeval *t, const char *component, const char *format,...) |
Log error message for specific time. More... | |
virtual void | tlog_debug (struct timeval *t, const char *component, Exception &e) |
Log debug exception for specific time. More... | |
virtual void | tlog_info (struct timeval *t, const char *component, Exception &e) |
Log informational exception for specific time. More... | |
virtual void | tlog_warn (struct timeval *t, const char *component, Exception &e) |
Log warning exception for specific time. More... | |
virtual void | tlog_error (struct timeval *t, const char *component, Exception &e) |
Log error exception for specific time. More... | |
virtual void | vtlog_debug (struct timeval *t, const char *component, const char *format, va_list va) |
Log debug message for specific time. More... | |
virtual void | vtlog_info (struct timeval *t, const char *component, const char *format, va_list va) |
Log informational message for specific time. More... | |
virtual void | vtlog_warn (struct timeval *t, const char *component, const char *format, va_list va) |
Log warning message for specific time. More... | |
virtual void | vtlog_error (struct timeval *t, const char *component, const char *format, va_list va) |
Log error message for specific time. More... | |
![]() | |
Logger (LogLevel log_level=LL_DEBUG) | |
Constructor. More... | |
virtual | ~Logger () |
Virtual empty destructor. More... | |
virtual void | set_loglevel (LogLevel level) |
Sets the log level. More... | |
virtual LogLevel | loglevel () |
Get log level. More... | |
virtual void | log (LogLevel level, const char *component, const char *format,...) |
Log message of given log level. More... | |
virtual void | log (LogLevel level, const char *component, Exception &e) |
Log exception for given log level. More... | |
virtual void | vlog (LogLevel level, const char *component, const char *format, va_list va) |
Log message for given log level. More... | |
virtual void | tlog (LogLevel level, struct timeval *t, const char *component, const char *format,...) |
Log message of given log level and time. More... | |
virtual void | tlog (LogLevel level, struct timeval *t, const char *component, Exception &e) |
Log exception for given log level. More... | |
virtual void | vtlog (LogLevel level, struct timeval *t, const char *component, const char *format, va_list va) |
Log message for given log level and time. More... | |
Additional Inherited Members | |
![]() | |
enum | LogLevel { LL_DEBUG = 0, LL_INFO = 1, LL_WARN = 2, LL_ERROR = 4, LL_NONE = 8 } |
Log level. More... | |
![]() | |
LogLevel | log_level |
Minimum log level. More... | |
Interface for logging to stderr.
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.
|
virtual |
Destructor.
Definition at line 60 of file console.cpp.
|
virtual |
Log debug message.
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 137 of file console.cpp.
References vlog_debug().
|
virtual |
Log debug exception.
component | component, used to distuinguish logged messages |
e | exception to log, exception messages will be logged |
Implements fawkes::Logger.
Definition at line 177 of file console.cpp.
References fawkes::Exception::begin(), fawkes::c_lightgray, fawkes::c_normal, fawkes::Exception::end(), fawkes::Logger::LL_DEBUG, fawkes::Mutex::lock(), fawkes::Logger::log_level, and fawkes::Mutex::unlock().
|
virtual |
Log error message.
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 167 of file console.cpp.
References vlog_error().
|
virtual |
Log error exception.
component | component, used to distuinguish logged messages |
e | exception to log, exception messages will be logged |
Implements fawkes::Logger.
Definition at line 234 of file console.cpp.
References fawkes::Exception::begin(), fawkes::c_normal, fawkes::c_red, fawkes::Exception::end(), fawkes::Logger::LL_ERROR, fawkes::Mutex::lock(), fawkes::Logger::log_level, and fawkes::Mutex::unlock().
|
virtual |
Log informational message.
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 147 of file console.cpp.
References vlog_info().
|
virtual |
Log informational exception.
component | component, used to distuinguish logged messages |
e | exception to log, exception messages will be logged |
Implements fawkes::Logger.
Definition at line 196 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().
|
virtual |
Log warning message.
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 157 of file console.cpp.
References vlog_warn().
|
virtual |
Log warning exception.
component | component, used to distuinguish logged messages |
e | exception to log, exception messages will be logged |
Implements fawkes::Logger.
Definition at line 215 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().
|
virtual |
Log debug message for specific time.
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 253 of file console.cpp.
References vtlog_debug().
|
virtual |
Log debug exception for specific time.
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 293 of file console.cpp.
References fawkes::Exception::begin(), fawkes::c_lightgray, fawkes::c_normal, fawkes::Exception::end(), fawkes::Logger::LL_DEBUG, fawkes::Mutex::lock(), fawkes::Logger::log_level, and fawkes::Mutex::unlock().
|
virtual |
Log error message for specific time.
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 283 of file console.cpp.
References vtlog_error().
|
virtual |
Log error exception for specific time.
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 344 of file console.cpp.
References fawkes::Exception::begin(), fawkes::c_normal, fawkes::c_red, fawkes::Exception::end(), fawkes::Logger::LL_ERROR, fawkes::Mutex::lock(), fawkes::Logger::log_level, and fawkes::Mutex::unlock().
|
virtual |
Log informational message for specific time.
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 263 of file console.cpp.
References vtlog_info().
|
virtual |
Log informational exception for specific time.
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 310 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().
|
virtual |
Log warning message for specific time.
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 273 of file console.cpp.
References vtlog_warn().
|
virtual |
Log warning exception for specific time.
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 327 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().
|
virtual |
Log debug message.
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 69 of file console.cpp.
References fawkes::c_lightgray, fawkes::c_normal, fawkes::Logger::LL_DEBUG, fawkes::Mutex::lock(), fawkes::Logger::log_level, and fawkes::Mutex::unlock().
Referenced by log_debug().
|
virtual |
Log error message.
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 120 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().
|
virtual |
Log informational message.
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 86 of file console.cpp.
References fawkes::Logger::LL_INFO, fawkes::Mutex::lock(), fawkes::Logger::log_level, and fawkes::Mutex::unlock().
Referenced by log_info().
|
virtual |
Log warning message.
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 103 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().
|
virtual |
Log debug message for specific time.
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 363 of file console.cpp.
References fawkes::c_lightgray, fawkes::c_normal, fawkes::Logger::LL_DEBUG, fawkes::Mutex::lock(), fawkes::Logger::log_level, and fawkes::Mutex::unlock().
Referenced by tlog_debug().
|
virtual |
Log error message for specific time.
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 408 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().
|
virtual |
Log informational message for specific time.
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 378 of file console.cpp.
References fawkes::Logger::LL_INFO, fawkes::Mutex::lock(), fawkes::Logger::log_level, and fawkes::Mutex::unlock().
Referenced by tlog_info().
|
virtual |
Log warning message for specific time.
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 393 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().