Changeset 675

Show
Ignore:
Timestamp:
10/23/06 19:01:53 (2 years ago)
Author:
common
Message:

nepenthes

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • nepenthes/trunk/modules/log-irc/log-irc.cpp

    r550 r675  
    232232bool LogIrc::Exit() 
    233233{ 
     234        if (g_Nepenthes->getLogMgr()->delLogger(this) == true) 
     235        { 
     236                logDebug("Unregisterd from logmanager\n"); 
     237        }else 
     238        { 
     239                logWarn("Could not unregister from logmanager\n"); 
     240        } 
    234241        return true; 
    235242} 
  • nepenthes/trunk/nepenthes-core/include/LogManager.hpp

    r652 r675  
    5656                void                            registerTag(uint32_t bit, const char *tag); 
    5757                virtual void            addLogger(LogHandler *lh, uint32_t filterMask); 
     58                virtual bool            delLogger(LogHandler *lh); 
    5859                virtual void            log(uint32_t mask, const char *message); 
    5960                virtual void            logf(uint32_t mask, const char *format, ...); 
  • nepenthes/trunk/nepenthes-core/src/LogManager.cpp

    r652 r675  
    122122} 
    123123 
     124bool LogManager::delLogger(LogHandler *lh) 
     125{ 
     126        list<LogHandlerEntry *>::iterator it; 
     127        for( it = m_Loggers.begin(); it != m_Loggers.end(); it++ ) 
     128        { 
     129                if ((*it)->m_Lh == lh) 
     130                { 
     131                m_Loggers.erase(it); 
     132                        delete *it; 
     133                        return true; 
     134                } 
     135        } 
     136        return false; 
     137} 
    124138 
    125139/**