mirror of
https://github.com/vcmi/vcmi.git
synced 2025-06-15 00:05:02 +02:00
Fixes excessive logging causing RMG slowdown
- Do not apply formatting on log entries that will be discarded due to high log level - Do not log incorrect access to visitablePos due to its numerous use by RMG
This commit is contained in:
@ -146,13 +146,16 @@ void CLogger::log(ELogLevel::ELogLevel level, const std::string & message) const
|
||||
|
||||
void CLogger::log(ELogLevel::ELogLevel level, const boost::format & fmt) const
|
||||
{
|
||||
try
|
||||
if (getEffectiveLevel() <= level)
|
||||
{
|
||||
log(level, fmt.str());
|
||||
}
|
||||
catch(...)
|
||||
{
|
||||
log(ELogLevel::ERROR, "Invalid log format!");
|
||||
try
|
||||
{
|
||||
log(level, fmt.str());
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
log(ELogLevel::ERROR, "Invalid log format!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user