diff options
| author | Giacomo Pozzoni <giacomopoz@gmail.com> | 2020-07-31 20:53:13 +0000 |
|---|---|---|
| committer | Shauren <shauren.trinity@gmail.com> | 2022-01-24 20:21:25 +0100 |
| commit | 61bf51874de432856ecd2c5794334bd256d4b014 (patch) | |
| tree | 036fbac3f31f1a60730b265e3f991d5c7377d900 /src/common/Logging | |
| parent | a21fca5ddfad330401d631bfd01a2485576b4d22 (diff) | |
Core/Misc: Fix static analysis issues (#25178)
(cherry picked from commit 7cf122fc2a604bae77d0b935536c41ec9203e62d)
Diffstat (limited to 'src/common/Logging')
| -rw-r--r-- | src/common/Logging/Log.cpp | 7 | ||||
| -rw-r--r-- | src/common/Logging/Log.h | 2 |
2 files changed, 5 insertions, 4 deletions
diff --git a/src/common/Logging/Log.cpp b/src/common/Logging/Log.cpp index 59baea2c143..6c364105a7b 100644 --- a/src/common/Logging/Log.cpp +++ b/src/common/Logging/Log.cpp @@ -287,12 +287,13 @@ std::string Log::GetTimestampStr() } } -bool Log::SetLogLevel(std::string const& name, char const* newLevelc, bool isLogger /* = true */) +bool Log::SetLogLevel(std::string const& name, int32 newLeveli, bool isLogger /* = true */) { - LogLevel newLevel = LogLevel(atoi(newLevelc)); - if (newLevel < 0) + if (newLeveli < 0) return false; + LogLevel newLevel = LogLevel(newLeveli); + if (isLogger) { auto it = loggers.begin(); diff --git a/src/common/Logging/Log.h b/src/common/Logging/Log.h index c5ca989ef5d..a496687ab57 100644 --- a/src/common/Logging/Log.h +++ b/src/common/Logging/Log.h @@ -66,7 +66,7 @@ class TC_COMMON_API Log void LoadFromConfig(); void Close(); bool ShouldLog(std::string const& type, LogLevel level) const; - bool SetLogLevel(std::string const& name, char const* level, bool isLogger = true); + bool SetLogLevel(std::string const& name, int32 level, bool isLogger = true); template<typename Format, typename... Args> inline void outMessage(std::string const& filter, LogLevel const level, Format&& fmt, Args&&... args) |
