Skip to content

Commit 760411a

Browse files
authored
Updated Logger to use std::function (#1892)
* Updated logger to use std::function for callback. * Lint
1 parent 5bc893d commit 760411a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Common++/header/Logger.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#include <mutex>
88
#include <ostream>
99
#include <sstream>
10+
#include <functional>
1011
#include "DeprecationUtils.h"
1112
#include "ObjectPool.h"
1213

@@ -245,8 +246,8 @@ namespace pcpp
245246
/// @param[in] method The method in PcapPlusPlus code the log message is coming from
246247
/// @param[in] line The line in PcapPlusPlus code the log message is coming from
247248
/// @remarks The printer callback should support being called from multiple threads simultaneously.
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)>;
249+
using LogPrinter = std::function<void(LogLevel logLevel, const std::string& logMessage, const std::string& file,
250+
const std::string& method, const int line)>;
250251

251252
/// A static method for converting the log level enum to a string.
252253
/// @param[in] logLevel A log level enum

0 commit comments

Comments
 (0)