From 8aa9745c4c7e80ffcbbd3f2377125ad08b30b661 Mon Sep 17 00:00:00 2001 From: Spp Date: Thu, 7 Nov 2013 16:34:44 +0100 Subject: Core/Logging: Extend logging system to allow inheritance of loggers - Changed default loggers and appenders - '.' determines the relation between loggers ("type.subtype" inherits "type" logger setting if logger "type.subtype" is not defined) - When core logs a message it search for the correct logger (root is the default one) ie: a message logged with "type.subtype" * Core will try to find a logger with name "type.subtype", if its not found then will search for "type", again if its not found it will return the default one "root" --- src/server/shared/Configuration/Config.cpp | 32 ++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'src/server/shared/Configuration/Config.cpp') diff --git a/src/server/shared/Configuration/Config.cpp b/src/server/shared/Configuration/Config.cpp index 47d59a57100..055c33b40ee 100644 --- a/src/server/shared/Configuration/Config.cpp +++ b/src/server/shared/Configuration/Config.cpp @@ -117,3 +117,35 @@ std::string const& ConfigMgr::GetFilename() GuardType guard(_configLock); return _filename; } + +std::list ConfigMgr::GetKeysByString(std::string const& name) +{ + GuardType guard(_configLock); + + std::list keys; + if (_config.get() == 0) + return keys; + + ACE_TString section_name; + ACE_Configuration_Section_Key section_key; + const ACE_Configuration_Section_Key &root_key = _config->root_section(); + + int i = 0; + while (_config->enumerate_sections(root_key, i++, section_name) == 0) + { + _config->open_section(root_key, section_name.c_str(), 0, section_key); + + ACE_TString key_name; + ACE_Configuration::VALUETYPE type; + int j = 0; + while (_config->enumerate_values(section_key, j++, key_name, type) == 0) + { + std::string temp = key_name.c_str(); + + if (!temp.find(name)) + keys.push_back(temp); + } + } + + return keys; +} -- cgit v1.2.3