Fawkes API
Fawkes Development Version
|
#include <>>
Static Public Member Functions | |
static Logger * | instance (const char *type, const char *as) |
Get logger instance. More... | |
static MultiLogger * | multilogger_instance (const char *as, Logger::LogLevel default_ll=Logger::LL_DEBUG) |
Create MultiLogger instance. More... | |
template<class L > | |
static L * | instance (const char *type, const char *as) |
Get typed instance of logger. More... | |
Logger factory.
This logging factory provides access to all loggers in a unified way. You just supply a logger argument string and depending on the logger type an instance of the desired logger is returned or otherwise an exception is thrown. See instance() for a list of supported logger types.
|
static |
Get logger instance.
Get an instance of a logger of the given type. The argument string is used for logger arguments. Supported logger types:
type | logger type |
as | logger argument string |
UnknownLoggerTypeException | thrown, if the desired logger could not be instantiated. This could be a misspelled logger type. |
Definition at line 99 of file factory.cpp.
References fawkes::UnknownLoggerTypeException::UnknownLoggerTypeException().
Referenced by instance().
|
static |
Get typed instance of logger.
Creates a new instance and converts it to the requested type. If the type does not match the requested logger an exception is thrown.
type | logger type |
as | logger argument string |
TypeMismatchException | thrown, if requested logger does not match requested type. |
Definition at line 70 of file factory.h.
References instance().
|
static |
Create MultiLogger instance.
This creates a multi logger instance based on the supplied argument string. The argument string is of the form
So it is a list of logger type/argument tuples separated by columns concatenated to one list with exclamation marks. The list is not pre-processed, so if you mention a logger twice this logger is added twice.
as | logger argument string |
default_ll | default log level for multi logger |
UnknownLoggerTypeException | thrown if any of the loggers was unknown. |
Definition at line 143 of file factory.cpp.
References fawkes::MultiLogger::add_logger(), fawkes::Exception::append(), fawkes::MultiLogger::set_loglevel(), fawkes::Logger::set_loglevel(), and fawkes::UnknownLoggerTypeException::UnknownLoggerTypeException().