Changeset 3021 for box/trunk/lib


Ignore:
Timestamp:
11/10/2011 23:11:54 (8 months ago)
Author:
chris
Message:

Fix illegal use of Logging::Add and Logging::Remove while iterating over loggers

File:
1 edited

Legend:

Unmodified
Added
Removed
  • box/trunk/lib/common/Logging.cpp

    r2984 r3021  
    470470         
    471471        /* avoid infinite loop if this throws an exception */ 
    472         Logging::Remove(this); 
     472        Log::Level oldLevel = GetLevel(); 
     473        Filter(Log::NOTHING); 
    473474 
    474475        std::ostringstream buf; 
     
    510511        mLogFile.Write(output.c_str(), output.length()); 
    511512 
    512         Logging::Add(this); 
     513        // no infinite loop, reset to saved logging level 
     514        Filter(oldLevel); 
    513515        return true; 
    514516} 
Note: See TracChangeset for help on using the changeset viewer.