when deleting Logger object, need to reset zmInitialized because we clear all the codes

This commit is contained in:
Isaac Connor 2018-03-29 12:24:00 -04:00
parent 3fe5bb6fe2
commit a56eafe796
1 changed files with 14 additions and 13 deletions

View File

@ -114,6 +114,7 @@ Logger::~Logger() {
terminate();
smCodes.clear();
smSyslogPriorities.clear();
smInitialised = false;
#if 0
for ( StringMap::iterator itr = smCodes.begin(); itr != smCodes.end(); itr ++ ) {
smCodes.erase( itr );
@ -314,7 +315,7 @@ const std::string &Logger::id(const std::string &id) {
mIdArgs = mId.substr(pos);
}
}
return( mId );
return mId;
}
Logger::Level Logger::level(Logger::Level level) {
@ -335,7 +336,7 @@ Logger::Level Logger::level(Logger::Level level) {
if ( mEffectiveLevel > mLevel)
mEffectiveLevel = mLevel;
}
return( mLevel );
return mLevel;
}
Logger::Level Logger::terminalLevel( Logger::Level terminalLevel ) {
@ -346,7 +347,7 @@ Logger::Level Logger::terminalLevel( Logger::Level terminalLevel ) {
if ( mTerminalLevel != terminalLevel )
mTerminalLevel = terminalLevel;
}
return( mTerminalLevel );
return mTerminalLevel;
}
Logger::Level Logger::databaseLevel( Logger::Level databaseLevel ) {
@ -360,7 +361,7 @@ Logger::Level Logger::databaseLevel( Logger::Level databaseLevel ) {
} // end if ( mDatabaseLevel != databaseLevel )
} // end if ( databaseLevel > NOOPT )
return( mDatabaseLevel );
return mDatabaseLevel;
}
Logger::Level Logger::fileLevel( Logger::Level fileLevel ) {
@ -373,7 +374,7 @@ Logger::Level Logger::fileLevel( Logger::Level fileLevel ) {
if ( mFileLevel > NOLOG )
openFile();
}
return( mFileLevel );
return mFileLevel;
}
Logger::Level Logger::syslogLevel( Logger::Level syslogLevel ) {
@ -387,7 +388,7 @@ Logger::Level Logger::syslogLevel( Logger::Level syslogLevel ) {
openSyslog();
}
}
return( mSyslogLevel );
return mSyslogLevel;
}
void Logger::logFile( const std::string &logFile ) {
@ -553,7 +554,7 @@ void Logger::logPrint( bool hex, const char * const filepath, const int line, co
if ( level <= mSyslogLevel ) {
int priority = smSyslogPriorities[level];
//priority |= LOG_DAEMON;
syslog( priority, "%s [%s] [%s]", classString, mId.c_str(), syslogStart );
syslog( priority, "%s [%d] [%s] [%s]", classString, priority, mId.c_str(), syslogStart );
}
free(filecopy);