diff --git a/src/common/Logging/Log.cpp b/src/common/Logging/Log.cpp index a59da3f53e..ca4b9581bf 100644 --- a/src/common/Logging/Log.cpp +++ b/src/common/Logging/Log.cpp @@ -262,10 +262,12 @@ std::string Log::GetTimestampStr() bool Log::SetLogLevel(std::string const& name, char const* newLevelc, bool isLogger /* = true */) { - LogLevel newLevel = LogLevel(atoi(newLevelc)); - if (static_cast(newLevel) < 0) + int32 newLeveli = atoi(newLevelc); + if (newLeveli < 0) return false; + LogLevel newLevel = static_cast(newLeveli); + if (isLogger) { auto it = loggers.begin();