@@ -143,7 +143,7 @@ namespace pcpp
143143
144144 // / An enum representing the log level. Currently 4 log levels are supported: Off, Error, Info and Debug. Info is
145145 // / the default log level
146- enum class LogLevel
146+ enum class LogLevel : uint8_t
147147 {
148148 Off = PCPP_LOG_LEVEL_OFF, // /< No log messages are emitted.
149149 Error = PCPP_LOG_LEVEL_ERROR, // /< Error level logs are emitted.
@@ -152,9 +152,9 @@ namespace pcpp
152152 Debug = PCPP_LOG_LEVEL_DEBUG // /< Debug level logs and above are emitted.
153153 };
154154
155- inline std::ostream& operator <<(std::ostream& s , LogLevel v )
155+ inline std::ostream& operator <<(std::ostream& ostr , LogLevel lvl )
156156 {
157- return s << static_cast <std::underlying_type <LogLevel>::type>(v );
157+ return ostr << static_cast <std::underlying_type_t <LogLevel>>(lvl );
158158 }
159159
160160 // Forward declaration
@@ -192,7 +192,7 @@ namespace pcpp
192192 // / @brief Appends to the message.
193193 // / @param value The value to append.
194194 // / @return A reference to this context.
195- template <class T > inline LogContext& operator <<(T const & value)
195+ template <class T > LogContext& operator <<(T const & value)
196196 {
197197 m_Stream << value;
198198 return *this ;
@@ -245,9 +245,8 @@ namespace pcpp
245245 // / @param[in] method The method in PcapPlusPlus code the log message is coming from
246246 // / @param[in] line The line in PcapPlusPlus code the log message is coming from
247247 // / @remarks The printer callback should support being called from multiple threads simultaneously.
248- using LogPrinter =
249- std::add_pointer<void (LogLevel logLevel, const std::string& logMessage, const std::string& file,
250- const std::string& method, const int line)>::type;
248+ using LogPrinter = std::add_pointer_t <void (LogLevel logLevel, const std::string& logMessage,
249+ const std::string& file, const std::string& method, const int line)>;
251250
252251 // / A static method for converting the log level enum to a string.
253252 // / @param[in] logLevel A log level enum
@@ -313,7 +312,7 @@ namespace pcpp
313312 // / @return Get the last error message
314313 std::string getLastError () const
315314 {
316- std::lock_guard<std::mutex> lock (m_LastErrorMtx);
315+ std::lock_guard<std::mutex> const lock (m_LastErrorMtx);
317316 return m_LastError;
318317 }
319318
@@ -394,7 +393,7 @@ namespace pcpp
394393
395394 private:
396395 bool m_LogsEnabled;
397- std::array<LogLevel, NumOfLogModules> m_LogModulesArray;
396+ std::array<LogLevel, NumOfLogModules> m_LogModulesArray{} ;
398397 LogPrinter m_LogPrinter;
399398
400399 mutable std::mutex m_LastErrorMtx;
0 commit comments