Fawkes API Fawkes Development Version

fawkes::LibLogger Class Reference

Library logger. More...

#include <>>

List of all members.

Static Public Member Functions

static void init (MultiLogger *multi_logger=NULL)
 Initialize logger.
static void finalize ()
 Delete internal logger.
static void add_logger (Logger *logger)
 Add logger.
static void remove_logger (Logger *logger)
 Remove logger.
static void log_debug (const char *component, const char *format,...)
 Log debug message.
static void log_info (const char *component, const char *format,...)
 Log informational message.
static void log_warn (const char *component, const char *format,...)
 Log warning message.
static void log_error (const char *component, const char *format,...)
 Log error message.
static void vlog_debug (const char *component, const char *format, va_list va)
 Log debug message.
static void vlog_info (const char *component, const char *format, va_list va)
 Log informational message.
static void vlog_warn (const char *component, const char *format, va_list va)
 Log warning message.
static void vlog_error (const char *component, const char *format, va_list va)
 Log error message.
static void log_debug (const char *component, Exception &e)
 Log debug message.
static void log_info (const char *component, Exception &e)
 Log informational message.
static void log_warn (const char *component, Exception &e)
 Log warning message.
static void log_error (const char *component, Exception &e)
 Log error message.

Detailed Description

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.

See also:
MultiLogger
Author:
Tim Niemueller

Definition at line 38 of file liblogger.h.


Member Function Documentation

void fawkes::LibLogger::add_logger ( Logger l) [static]

Add logger.

Parameters:
lsub-logger to add
See also:
MultiLogger::add_logger()

Definition at line 95 of file liblogger.cpp.

References fawkes::MultiLogger::add_logger(), init(), fawkes::Mutex::lock(), and fawkes::Mutex::unlock().

void fawkes::LibLogger::finalize ( ) [static]

Delete internal logger.

Note that the multi logger took over ownership of the loggers.

See also:
MultiLogger

Definition at line 83 of file liblogger.cpp.

void fawkes::LibLogger::init ( MultiLogger multi_logger = NULL) [static]

Initialize logger.

Parameters:
multi_loggerLogger 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().

void fawkes::LibLogger::log_debug ( const char *  component,
const char *  format,
  ... 
) [static]

Log debug message.

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

Definition at line 124 of file liblogger.cpp.

References init(), fawkes::Mutex::lock(), fawkes::Mutex::unlock(), and fawkes::MultiLogger::vlog_debug().

Referenced by fawkes::BlackBoardNetworkHandler::client_disconnected(), fawkes::PluginNetworkHandler::loop(), fawkes::BlackBoardNetworkHandler::loop(), and fawkes::FileAlterationMonitor::watch_dir().

void fawkes::LibLogger::log_debug ( const char *  component,
Exception e 
) [static]

Log debug message.

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

Definition at line 260 of file liblogger.cpp.

References init(), fawkes::Mutex::lock(), fawkes::MultiLogger::log_debug(), and fawkes::Mutex::unlock().

void fawkes::LibLogger::log_error ( const char *  component,
const char *  format,
  ... 
) [static]
void fawkes::LibLogger::log_error ( const char *  component,
Exception e 
) [static]

Log error message.

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

Definition at line 301 of file liblogger.cpp.

References init(), fawkes::Mutex::lock(), fawkes::MultiLogger::log_error(), and fawkes::Mutex::unlock().

void fawkes::LibLogger::log_info ( const char *  component,
const char *  format,
  ... 
) [static]

Log informational message.

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

Definition at line 142 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().

void fawkes::LibLogger::log_info ( const char *  component,
Exception e 
) [static]

Log informational message.

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

Definition at line 273 of file liblogger.cpp.

References init(), fawkes::Mutex::lock(), fawkes::MultiLogger::log_info(), and fawkes::Mutex::unlock().

void fawkes::LibLogger::log_warn ( const char *  component,
const char *  format,
  ... 
) [static]

Log warning message.

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

Definition at line 160 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_comment_changed(), fawkes::PluginManager::config_value_changed(), fawkes::ConfigNetworkHandler::config_value_changed(), fawkes::ConfigNetworkHandler::config_value_erased(), fawkes::PluginManager::fam_event(), FawkesNetworkManager::FawkesNetworkManager(), fawkes::NetworkConfiguration::inbound_received(), fawkes::ConfigNetworkHandler::loop(), fawkes::BlackBoardNetworkHandler::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::FileAlterationMonitor::process_events(), fawkes::BlackBoardInterfaceProxy::process_interface_message(), fawkes::WorldInfoTransceiver::recv(), fawkes::BlackBoardNotifier::register_listener(), and fawkes::BlackBoardMessageManager::transmit().

void fawkes::LibLogger::log_warn ( const char *  component,
Exception e 
) [static]

Log warning message.

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

Definition at line 287 of file liblogger.cpp.

References init(), fawkes::Mutex::lock(), fawkes::MultiLogger::log_warn(), and fawkes::Mutex::unlock().

void fawkes::LibLogger::remove_logger ( Logger l) [static]

Remove logger.

Parameters:
lsub-logger to remove
See also:
MultiLogger::remove_logger()

Definition at line 109 of file liblogger.cpp.

References init(), fawkes::Mutex::lock(), fawkes::MultiLogger::remove_logger(), and fawkes::Mutex::unlock().

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

Log debug message.

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

Definition at line 197 of file liblogger.cpp.

References init(), fawkes::Mutex::lock(), fawkes::Mutex::unlock(), and fawkes::MultiLogger::vlog_debug().

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

Log error message.

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

Definition at line 245 of file liblogger.cpp.

References init(), fawkes::Mutex::lock(), fawkes::Mutex::unlock(), and fawkes::MultiLogger::vlog_error().

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

Log informational message.

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

Definition at line 213 of file liblogger.cpp.

References init(), fawkes::Mutex::lock(), fawkes::Mutex::unlock(), and fawkes::MultiLogger::vlog_info().

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

Log warning message.

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

Definition at line 229 of file liblogger.cpp.

References init(), fawkes::Mutex::lock(), fawkes::Mutex::unlock(), and fawkes::MultiLogger::vlog_warn().


The documentation for this class was generated from the following files:
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends