mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-21 17:54:48 +01:00
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"
This commit is contained in:
@@ -117,3 +117,35 @@ std::string const& ConfigMgr::GetFilename()
|
||||
GuardType guard(_configLock);
|
||||
return _filename;
|
||||
}
|
||||
|
||||
std::list<std::string> ConfigMgr::GetKeysByString(std::string const& name)
|
||||
{
|
||||
GuardType guard(_configLock);
|
||||
|
||||
std::list<std::string> 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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user