Core/Log: Reload log levels and filters

on 'reload config' command
This commit is contained in:
Fredi Machado
2011-09-08 23:00:26 -03:00
parent 7a9cb4fdc7
commit bac261b001
3 changed files with 13 additions and 0 deletions
+2
View File
@@ -398,6 +398,8 @@ void World::LoadConfigSettings(bool reload)
sLog->outError("World settings reload fail: can't read settings from %s.", sConfig->GetFilename().c_str()); sLog->outError("World settings reload fail: can't read settings from %s.", sConfig->GetFilename().c_str());
return; return;
} }
sLog->ReloadConfig(); // Reload log levels and filters
} }
///- Read the player limit and the Message of the day from the config file ///- Read the player limit and the Message of the day from the config file
+9
View File
@@ -187,6 +187,15 @@ void Log::Initialize()
} }
} }
void Log::ReloadConfig()
{
m_logLevel = sConfig->GetIntDefault("LogLevel", LOGL_NORMAL);
m_logFileLevel = sConfig->GetIntDefault("LogFileLevel", LOGL_NORMAL);
m_dbLogLevel = sConfig->GetIntDefault("DBLogLevel", LOGL_NORMAL);
m_DebugLogMask = DebugLogFilters(sConfig->GetIntDefault("DebugLogMask", LOG_FILTER_NONE));
}
FILE* Log::openLogFile(char const* configFileName, char const* configTimeStampFlag, char const* mode) FILE* Log::openLogFile(char const* configFileName, char const* configTimeStampFlag, char const* mode)
{ {
std::string logfn=sConfig->GetStringDefault(configFileName, ""); std::string logfn=sConfig->GetStringDefault(configFileName, "");
+2
View File
@@ -108,6 +108,8 @@ class Log
public: public:
void Initialize(); void Initialize();
void ReloadConfig();
void InitColors(const std::string& init_str); void InitColors(const std::string& init_str);
void SetColor(bool stdout_stream, ColorTypes color); void SetColor(bool stdout_stream, ColorTypes color);
void ResetColor(bool stdout_stream); void ResetColor(bool stdout_stream);