proxygen
|
#include <LogConfig.h>
Public Types | |
using | CategoryConfigMap = std::unordered_map< std::string, LogCategoryConfig > |
using | HandlerConfigMap = std::unordered_map< std::string, LogHandlerConfig > |
Public Member Functions | |
LogConfig ()=default | |
LogConfig (HandlerConfigMap handlerConfigs, CategoryConfigMap catConfigs) | |
const CategoryConfigMap & | getCategoryConfigs () const |
const HandlerConfigMap & | getHandlerConfigs () const |
bool | operator== (const LogConfig &other) const |
bool | operator!= (const LogConfig &other) const |
void | update (const LogConfig &other) |
Private Attributes | |
HandlerConfigMap | handlerConfigs_ |
CategoryConfigMap | categoryConfigs_ |
LogConfig contains configuration for the LoggerDB.
This includes information about the log levels for log categories, as well as what log handlers are configured and which categories they are attached to.
Definition at line 33 of file LogConfig.h.
using folly::LogConfig::CategoryConfigMap = std::unordered_map<std::string, LogCategoryConfig> |
Definition at line 35 of file LogConfig.h.
using folly::LogConfig::HandlerConfigMap = std::unordered_map<std::string, LogHandlerConfig> |
Definition at line 36 of file LogConfig.h.
|
default |
|
inlineexplicit |
|
inline |
Definition at line 45 of file LogConfig.h.
References categoryConfigs_.
Referenced by folly::logConfigToDynamic(), folly::operator<<(), folly::LoggerDB::resetConfig(), folly::LoggerDB::startConfigUpdate(), and folly::LoggerDB::updateConfig().
|
inline |
Definition at line 48 of file LogConfig.h.
References handlerConfigs_, operator!=(), operator==(), and update().
Referenced by folly::logConfigToDynamic(), folly::operator<<(), and folly::LoggerDB::startConfigUpdate().
bool folly::LogConfig::operator!= | ( | const LogConfig & | other | ) | const |
Definition at line 27 of file LogConfig.cpp.
Referenced by getHandlerConfigs().
bool folly::LogConfig::operator== | ( | const LogConfig & | other | ) | const |
Definition at line 22 of file LogConfig.cpp.
References categoryConfigs_, and handlerConfigs_.
Referenced by getHandlerConfigs().
void folly::LogConfig::update | ( | const LogConfig & | other | ) |
Update this LogConfig object by merging in settings from another LogConfig.
All LogHandler settings from the other LogConfig will be inserted into this LogConfig. If a log handler with the same name was already defined in this LogConfig it will be replaced with the new settings.
All LogCategory settings from the other LogConfig will be inserted into this LogConfig. If a log category with the same name was already defined in this LogConfig, its settings will be updated with settings from the other LogConfig. However, if the other LogConfig does not define handler settings for the category it will retain its current handler settings.
This method allows LogConfig objects to be combined before applying them. Using LogConfig::update() will produce the same results as if LoggerDB::updateConfig() had been called with both configs sequentially. In other words, this operation:
configA.update(configB); loggerDB.updateConfig(configA);
will produce the same results as:
loggerDB.updateConfig(configA); loggerDB.updateConfig(configA);
Definition at line 31 of file LogConfig.cpp.
References categoryConfigs_, handlerConfigs_, and folly::gen::move.
Referenced by getHandlerConfigs(), and folly::initLogging().
|
private |
Definition at line 86 of file LogConfig.h.
Referenced by getCategoryConfigs(), LogConfig(), operator==(), and update().
|
private |
Definition at line 85 of file LogConfig.h.
Referenced by getHandlerConfigs(), operator==(), and update().