Fawkes API
Fawkes Development Version
|
Library logger. More...
#include <>>
Static Public Member Functions | |
static void | init (MultiLogger *multi_logger=NULL) |
Initialize logger. More... | |
static void | finalize () |
Delete internal logger. More... | |
static void | add_logger (Logger *logger) |
Add logger. More... | |
static void | remove_logger (Logger *logger) |
Remove logger. More... | |
static void | log_debug (const char *component, const char *format,...) |
Log debug message. More... | |
static void | log_info (const char *component, const char *format,...) |
Log informational message. More... | |
static void | log_warn (const char *component, const char *format,...) |
Log warning message. More... | |
static void | log_error (const char *component, const char *format,...) |
Log error message. More... | |
static void | vlog_debug (const char *component, const char *format, va_list va) |
Log debug message. More... | |
static void | vlog_info (const char *component, const char *format, va_list va) |
Log informational message. More... | |
static void | vlog_warn (const char *component, const char *format, va_list va) |
Log warning message. More... | |
static void | vlog_error (const char *component, const char *format, va_list va) |
Log error message. More... | |
static void | log_debug (const char *component, Exception &e) |
Log debug message. More... | |
static void | log_info (const char *component, Exception &e) |
Log informational message. More... | |
static void | log_warn (const char *component, Exception &e) |
Log warning message. More... | |
static void | log_error (const char *component, Exception &e) |
Log error message. More... | |
Library logger.
This logger is meant to be used in libraries that depend on utils anyway and in utils itself. This logger is completely static so it only has to be initialized once per process. If the logger is used before it has been initialized it is automatically initialized with an empty MultiLogger. If you want to see output you have to make sure that you add loggers like the ConsoleLogger.
Make sure that you call finalize() at the end of the surrounding process to free all the loggers associcated with the internal multi logger and the multi logger itself.
Definition at line 38 of file liblogger.h.
|
static |
Add logger.
l | sub-logger to add |
Definition at line 97 of file liblogger.cpp.
References fawkes::MultiLogger::add_logger(), init(), fawkes::Mutex::lock(), and fawkes::Mutex::unlock().
|
static |
Delete internal logger.
Note that the multi logger took over ownership of the loggers.
Definition at line 83 of file liblogger.cpp.
|
static |
Initialize logger.
multi_logger | Logger to use in this multi logger. If NULL a new logger is created. Note that LibLogger takes over ownership of the multi logger and will destroy it if finalize() is called. |
Definition at line 63 of file liblogger.cpp.
Referenced by add_logger(), log_debug(), log_error(), log_info(), log_warn(), remove_logger(), vlog_debug(), vlog_error(), vlog_info(), and vlog_warn().
|
static |
Log debug message.
component | component, used to distuinguish logged messages |
format | format of the message, see man page of sprintf for available tokens. |
Definition at line 126 of file liblogger.cpp.
References init(), fawkes::Mutex::lock(), fawkes::Mutex::unlock(), and fawkes::MultiLogger::vlog_debug().
Referenced by fawkes::BlackBoardNetworkHandler::client_disconnected(), and fawkes::BlackBoardNetworkHandler::loop().
|
static |
Log debug message.
component | component, used to distuinguish logged messages |
e | exception to log, exception messages will be logged |
Definition at line 262 of file liblogger.cpp.
References init(), fawkes::Mutex::lock(), fawkes::MultiLogger::log_debug(), and fawkes::Mutex::unlock().
|
static |
Log error message.
component | component, used to distuinguish logged messages |
format | format of the message, see man page of sprintf for available tokens. |
Definition at line 180 of file liblogger.cpp.
References init(), fawkes::Mutex::lock(), fawkes::Mutex::unlock(), and fawkes::MultiLogger::vlog_error().
Referenced by fawkes::BlackBoardNetworkHandler::loop(), fawkes::PluginNetworkHandler::loop(), fawkes::BlackBoardInterfaceProxy::process_data_changed(), fawkes::BlackBoardInterfaceProxy::process_interface_message(), fawkes::LuaContext::restart(), firevision::SurfClassifier::SurfClassifier(), fawkes::PluginManager::unload(), and fawkes::PluginNetworkHandler::~PluginNetworkHandler().
|
static |
Log error message.
component | component, used to distuinguish logged messages |
e | exception to log, exception messages will be logged |
Definition at line 303 of file liblogger.cpp.
References init(), fawkes::Mutex::lock(), fawkes::MultiLogger::log_error(), and fawkes::Mutex::unlock().
|
static |
Log informational message.
component | component, used to distuinguish logged messages |
format | format of the message, see man page of sprintf for available tokens. |
Definition at line 144 of file liblogger.cpp.
References init(), fawkes::Mutex::lock(), fawkes::Mutex::unlock(), and fawkes::MultiLogger::vlog_info().
Referenced by fawkes::PluginManager::fam_event(), fawkes::PluginManager::load(), fawkes::PluginNetworkHandler::loop(), and fawkes::PluginManager::unload().
|
static |
Log informational message.
component | component, used to distuinguish logged messages |
e | exception to log, exception messages will be logged |
Definition at line 275 of file liblogger.cpp.
References init(), fawkes::Mutex::lock(), fawkes::MultiLogger::log_info(), and fawkes::Mutex::unlock().
|
static |
Log warning message.
component | component, used to distuinguish logged messages |
format | format of the message, see man page of sprintf for available tokens. |
Definition at line 162 of file liblogger.cpp.
References init(), fawkes::Mutex::lock(), fawkes::Mutex::unlock(), and fawkes::MultiLogger::vlog_warn().
Referenced by fawkes::BlackBoardNetHandlerInterfaceListener::bb_interface_data_changed(), fawkes::BlackBoardNetHandlerInterfaceListener::bb_interface_message_received(), fawkes::ConfigNetworkHandler::client_disconnected(), fawkes::ConfigNetworkHandler::config_value_changed(), fawkes::ConfigNetworkHandler::config_value_erased(), fawkes::PluginManager::fam_event(), fawkes::YamlConfiguration::fam_event(), fawkes::NetworkConfiguration::inbound_received(), fawkes::PluginManager::init_pinfo_cache(), fawkes::BlackBoardNetworkHandler::loop(), fawkes::ConfigNetworkHandler::loop(), fawkes::BlackBoardNotifier::notify_of_data_change(), fawkes::BlackBoardNotifier::notify_of_message_received(), fawkes::BlackBoardNotifier::notify_of_reader_added(), fawkes::BlackBoardNotifier::notify_of_reader_removed(), fawkes::BlackBoardNotifier::notify_of_writer_added(), fawkes::BlackBoardNotifier::notify_of_writer_removed(), fawkes::PluginManager::PluginManager(), fawkes::BlackBoardInterfaceProxy::process_interface_message(), fawkes::PluginManager::remove_listener(), fawkes::LuaContext::restart(), fawkes::BlackBoardMessageManager::transmit(), fawkes::BlackBoardNotifier::update_listener(), fawkes::BlackBoardNetHandlerInterfaceObserver::~BlackBoardNetHandlerInterfaceObserver(), fawkes::ConfigNetworkHandler::~ConfigNetworkHandler(), and fawkes::PluginNetworkHandler::~PluginNetworkHandler().
|
static |
Log warning message.
component | component, used to distuinguish logged messages |
e | exception to log, exception messages will be logged |
Definition at line 289 of file liblogger.cpp.
References init(), fawkes::Mutex::lock(), fawkes::MultiLogger::log_warn(), and fawkes::Mutex::unlock().
|
static |
Remove logger.
l | sub-logger to remove |
Definition at line 111 of file liblogger.cpp.
References init(), fawkes::Mutex::lock(), fawkes::MultiLogger::remove_logger(), and fawkes::Mutex::unlock().
|
static |
Log debug message.
component | component, used to distuinguish logged messages |
format | format of the message, see man page of sprintf for available tokens. |
va | variadic argument list |
Definition at line 199 of file liblogger.cpp.
References init(), fawkes::Mutex::lock(), fawkes::Mutex::unlock(), and fawkes::MultiLogger::vlog_debug().
|
static |
Log error message.
component | component, used to distuinguish logged messages |
format | format of the message, see man page of sprintf for available tokens. |
va | variadic argument list |
Definition at line 247 of file liblogger.cpp.
References init(), fawkes::Mutex::lock(), fawkes::Mutex::unlock(), and fawkes::MultiLogger::vlog_error().
|
static |
Log informational message.
component | component, used to distuinguish logged messages |
format | format of the message, see man page of sprintf for available tokens. |
va | variadic argument list |
Definition at line 215 of file liblogger.cpp.
References init(), fawkes::Mutex::lock(), fawkes::Mutex::unlock(), and fawkes::MultiLogger::vlog_info().
|
static |
Log warning message.
component | component, used to distuinguish logged messages |
format | format of the message, see man page of sprintf for available tokens. |
va | variadic argument list |
Definition at line 231 of file liblogger.cpp.
References init(), fawkes::Mutex::lock(), fawkes::Mutex::unlock(), and fawkes::MultiLogger::vlog_warn().