diff options
author | Subv <s.v.h21@hotmail.com> | 2012-08-27 15:30:27 -0500 |
---|---|---|
committer | Subv <s.v.h21@hotmail.com> | 2012-08-27 15:30:27 -0500 |
commit | 9fe45d68707d45f7a82e3314566edc66ff1d84a2 (patch) | |
tree | 6e4fdd7152467f7b0935123a4ec196397284d3d9 /src/server/shared/Logging/Log.cpp | |
parent | 02bbd1154eb3e119fb095850e60e3dc11ee937b1 (diff) | |
parent | 9a11dc5ea6a56c41c044d5b28323d2fb420e3201 (diff) |
Merge branch 'master' of github.com:TrinityCore/TrinityCore into mmaps
Diffstat (limited to 'src/server/shared/Logging/Log.cpp')
-rwxr-xr-x | src/server/shared/Logging/Log.cpp | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/src/server/shared/Logging/Log.cpp b/src/server/shared/Logging/Log.cpp index 3a24190d8fa..6e17a32c78b 100755 --- a/src/server/shared/Logging/Log.cpp +++ b/src/server/shared/Logging/Log.cpp @@ -260,14 +260,9 @@ void Log::ReadLoggersFromConfig() } while (ss); - LoggerMap::const_iterator it = loggers.begin(); - - while (it != loggers.end() && it->first) - ++it; - // root logger must exist. Marking as disabled as its not configured - if (it == loggers.end()) - loggers[0].Create("root", LOG_FILTER_GENERAL, LOG_LEVEL_DISABLED); + if (loggers.find(LOG_FILTER_GENERAL) == loggers.end()) + loggers[LOG_FILTER_GENERAL].Create("root", LOG_FILTER_GENERAL, LOG_LEVEL_DISABLED); } void Log::EnableDBAppenders() @@ -349,10 +344,7 @@ bool Log::SetLogLevel(std::string const& name, const char* newLevelc, bool isLog bool Log::ShouldLog(LogFilterType type, LogLevel level) const { - LoggerMap::const_iterator it = loggers.begin(); - while (it != loggers.end() && it->second.getType() != type) - ++it; - + LoggerMap::const_iterator it = loggers.find(type); if (it != loggers.end()) { LogLevel loggerLevel = it->second.getLogLevel(); |