Ignore:
Timestamp:
13/09/2008 16:11:35 (4 years ago)
Author:
chris
Message:

Unify program name and console logging tags.

Add a new class, Logging::Tagger, which can be used to temporarily
add information to the program name, such as the client ID in bbstored.

File:
1 edited

Legend:

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

    r2231 r2279  
    3636Log::Level  Logging::sGlobalLevel = Log::EVERYTHING; 
    3737Logging     Logging::sGlobalLogging; //automatic initialisation 
     38std::string Logging::sProgramName; 
    3839 
    3940Logging::Logging() 
     
    207208void Logging::SetProgramName(const std::string& rProgramName) 
    208209{ 
     210        sProgramName = rProgramName; 
     211 
    209212        for (std::vector<Logger*>::iterator i = sLoggers.begin(); 
    210213                i != sLoggers.end(); i++) 
     
    231234std::string Console::sTag; 
    232235 
    233 void Console::SetTag(const std::string& rTag) 
    234 { 
    235         sTag = rTag; 
    236         sShowTag = true; 
     236void Console::SetProgramName(const std::string& rProgramName) 
     237{ 
     238        sTag = rProgramName; 
     239} 
     240 
     241void Console::SetShowTag(bool enabled) 
     242{ 
     243        sShowTag = enabled; 
    237244} 
    238245 
Note: See TracChangeset for help on using the changeset viewer.