Shared/Logs: Improve log performances
Improve Log::ShouldLog() performances by saving the lowest log level across all loggers and discarding any log with lower level than that.
This commit is contained in:
1 parent
7737267fc8
commit
003d67708b
2 files changed
+9
No files matched your search
@@ -199,6 +199,9 @@ void Log::CreateLoggerFromConfig(std::string const& appenderName)
|
||||
return;
|
||||
}
|
||||
|
||||
if (level < lowestLogLevel)
|
||||
lowestLogLevel = level;
|
||||
|
||||
logger.Create(name, level);
|
||||
//fprintf(stdout, "Log::CreateLoggerFromConfig: Created Logger %s, Level %u\n", name.c_str(), level);
|
||||
|
||||
@@ -394,6 +397,7 @@ void Log::LoadFromConfig()
|
||||
{
|
||||
Close();
|
||||
|
||||
lowestLogLevel = LOG_LEVEL_FATAL;
|
||||
AppenderId = 0;
|
||||
m_logsDir = sConfigMgr->GetStringDefault("LogsDir", "");
|
||||
if (!m_logsDir.empty())
|
||||
|
||||
Reference in new issue
Block a user