RSC
0.17.1
|
A class which configures the logging tree using configuration subsystem of RSC. More...
#include <OptionBasedConfigurator.h>
Public Member Functions | |
OptionBasedConfigurator (const std::vector< std::string > &rootOption=getDefaultRootOption()) | |
Constructs a new configurator with a specified root option. More... | |
virtual | ~OptionBasedConfigurator () |
Destructor. More... | |
std::vector< std::string > | getRootOption () const |
Returns the option root used by this configurator. More... | |
virtual void | handleOption (const std::vector< std::string > &key, const std::string &value) |
This method is called once for each individual option available from a given ConfigSource. More... | |
Public Member Functions inherited from rsc::config::OptionHandler | |
virtual | ~OptionHandler () |
Static Public Member Functions | |
static std::vector< std::string > | getDefaultRootOption () |
Returns the default config entry assumed for the root logger. More... | |
Private Member Functions | |
bool | keyStartWithRoot (const std::vector< std::string > &key) const |
std::string | loggerNameFromKey (const std::vector< std::string > &key) const |
std::string | settingFromKey (const std::vector< std::string > &key) const |
std::vector< std::string > | normalizeKey (const std::vector< std::string > &key) const |
Private Attributes | |
std::vector< std::string > | rootOption |
A class which configures the logging tree using configuration subsystem of RSC.
The usual logging hierarchy is mapped onto the hierarchy of options in the config interface with a prefix to prevent name clashes. This e.g. means that the root logger can be configured with the default prefix rsc.logging
. This is called the root option.
This class can be used multiple times. Newer options override older ones.
Definition at line 46 of file OptionBasedConfigurator.h.
rsc::logging::OptionBasedConfigurator::OptionBasedConfigurator | ( | const std::vector< std::string > & | rootOption = getDefaultRootOption() | ) |
Constructs a new configurator with a specified root option.
rootOption | the root in the option namespace containing the logger configurations |
Definition at line 41 of file OptionBasedConfigurator.cpp.
|
virtual |
Destructor.
Definition at line 46 of file OptionBasedConfigurator.cpp.
|
static |
Returns the default config entry assumed for the root logger.
Definition at line 49 of file OptionBasedConfigurator.cpp.
vector< string > rsc::logging::OptionBasedConfigurator::getRootOption | ( | ) | const |
Returns the option root used by this configurator.
config | option representation for the root option which contains all logging configurations |
Definition at line 56 of file OptionBasedConfigurator.cpp.
References rootOption.
|
virtual |
This method is called once for each individual option available from a given ConfigSource.
key | A list of hierarchical key components that identify the option. |
value | The value of the option. |
Implements rsc::config::OptionHandler.
Definition at line 96 of file OptionBasedConfigurator.cpp.
References rsc::patterns::Singleton< LoggerFactory >::getInstance(), rsc::logging::Logger::getLogger(), keyStartWithRoot(), rsc::logging::Logger::LEVEL_ALL, rsc::logging::Logger::LEVEL_DEBUG, rsc::logging::Logger::LEVEL_ERROR, rsc::logging::Logger::LEVEL_FATAL, rsc::logging::Logger::LEVEL_INFO, rsc::logging::Logger::LEVEL_OFF, rsc::logging::Logger::LEVEL_TRACE, rsc::logging::Logger::LEVEL_WARN, loggerNameFromKey(), normalizeKey(), and rootOption.
|
private |
Definition at line 60 of file OptionBasedConfigurator.cpp.
References rootOption.
Referenced by handleOption().
|
private |
Definition at line 79 of file OptionBasedConfigurator.cpp.
References rootOption.
Referenced by handleOption().
|
private |
Definition at line 141 of file OptionBasedConfigurator.cpp.
Referenced by handleOption().
|
private |
|
private |
Definition at line 90 of file OptionBasedConfigurator.h.
Referenced by getRootOption(), handleOption(), keyStartWithRoot(), and loggerNameFromKey().