diff options
author | Chris Wilson <chris+github@qwirx.com> | 2011-10-11 22:11:54 +0000 |
---|---|---|
committer | Chris Wilson <chris+github@qwirx.com> | 2011-10-11 22:11:54 +0000 |
commit | 1ff4e4c92d69c3ed83d93f96399f6a9bc34af3c6 (patch) | |
tree | 3e530e0ed7c156632f799ea1543892c96eb6f693 /lib/common/Logging.cpp | |
parent | c99f9f2bc122260336d35660a47c7eaa9f36c2c8 (diff) |
Fix illegal use of Logging::Add and Logging::Remove while iterating over loggers
Diffstat (limited to 'lib/common/Logging.cpp')
-rw-r--r-- | lib/common/Logging.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/common/Logging.cpp b/lib/common/Logging.cpp index 83efbc23..f7f72713 100644 --- a/lib/common/Logging.cpp +++ b/lib/common/Logging.cpp @@ -469,7 +469,8 @@ bool FileLogger::Log(Log::Level Level, const std::string& rFile, } /* avoid infinite loop if this throws an exception */ - Logging::Remove(this); + Log::Level oldLevel = GetLevel(); + Filter(Log::NOTHING); std::ostringstream buf; buf << FormatTime(GetCurrentBoxTime(), true, false); @@ -509,7 +510,8 @@ bool FileLogger::Log(Log::Level Level, const std::string& rFile, mLogFile.Write(output.c_str(), output.length()); - Logging::Add(this); + // no infinite loop, reset to saved logging level + Filter(oldLevel); return true; } |