11 #define LOG_MODULE UndefinedLogModule 116 typedef void (*
LogPrinter)(
LogLevel logLevel,
const std::string& logMessage,
const std::string& file,
const std::string& method,
const int line);
185 Logger& operator<<(
const T& msg)
187 (*m_LogStream) << msg;
191 std::ostringstream * internalCreateLogStream();
212 std::string m_LastError;
213 std::ostringstream* m_LogStream;
218 static void defaultLogPrinter(
LogLevel logLevel,
const std::string& logMessage,
const std::string& file,
const std::string& method,
const int line);
221 #define PCPP_LOG_DEBUG(message) do \ 223 if (pcpp::Logger::getInstance().logsEnabled() && pcpp::Logger::getInstance().isDebugEnabled(LOG_MODULE)) \ 225 std::ostringstream* sstream = pcpp::Logger::getInstance().internalCreateLogStream(); \ 226 (*sstream) << message; \ 227 pcpp::Logger::getInstance().internalPrintLogMessage(sstream, pcpp::Logger::Debug, __FILE__, __FUNCTION__, __LINE__); \ 231 #define PCPP_LOG_ERROR(message) do \ 233 std::ostringstream* sstream = pcpp::Logger::getInstance().internalCreateLogStream(); \ 234 (*sstream) << message; \ 235 pcpp::Logger::getInstance().internalPrintLogMessage(sstream, pcpp::Logger::Error, __FILE__, __FUNCTION__, __LINE__); \ The main namespace for the PcapPlusPlus lib.
LogLevel
Definition: Logger.h:100
IcmpLayer module (Packet++)
Definition: Logger.h:47
static Logger & getInstance()
Definition: Logger.h:203
PfRingDevice module (Pcap++)
Definition: Logger.h:68
void setLogLevel(LogModule module, LogLevel level)
Definition: Logger.h:137
bool isDebugEnabled(LogModule module) const
Definition: Logger.h:144
LogModule
Definition: Logger.h:26
SdpLayer module (Packet++)
Definition: Logger.h:55
SllLayer module (Packet++)
Definition: Logger.h:50
Packet module (Packet++)
Definition: Logger.h:33
RadiusLayer module (Packet++)
Definition: Logger.h:56
std::string getLastError()
Definition: Logger.h:166
DhcpV6Layer module (Packet++)
Definition: Logger.h:52
MBufRawPacket module (Pcap++)
Definition: Logger.h:69
PayloadLayer module (Packet++)
Definition: Logger.h:39
VlanLayer module (Packet++)
Definition: Logger.h:42
IP Utils module (Common++)
Definition: Logger.h:29
NtpLayer module (Packet++)
Definition: Logger.h:63
IPReassembly module (Packet++)
Definition: Logger.h:61
void internalPrintLogMessage(std::ostringstream *logStream, Logger::LogLevel logLevel, const char *file, const char *method, int line)
HttpLayer module (Packet++)
Definition: Logger.h:43
LogLevel getLogLevel(LogModule module)
Definition: Logger.h:130
bool logsEnabled() const
Definition: Logger.h:182
Error log level.
Definition: Logger.h:102
SipLayer module (Packet++)
Definition: Logger.h:54
IgmpLayer module (Packet++)
Definition: Logger.h:53
Info log level.
Definition: Logger.h:103
DnsLayer module (Packet++)
Definition: Logger.h:45
RawPacket module (Packet++)
Definition: Logger.h:32
SSHLayer module (Packet++)
Definition: Logger.h:59
PcapLiveDevice module (Pcap++)
Definition: Logger.h:66
IPSecLayers module (Packet++)
Definition: Logger.h:62
GtpLayer module (Packet++)
Definition: Logger.h:57
DpdkDevice module (Pcap++)
Definition: Logger.h:70
void setLogPrinter(LogPrinter printer)
Definition: Logger.h:156
MplsLayer module (Packet++)
Definition: Logger.h:46
IPv4Layer module (Packet++)
Definition: Logger.h:37
FileDevice module (Pcap++)
Definition: Logger.h:67
Generic Utils (Common++)
Definition: Logger.h:31
static std::string logLevelAsString(LogLevel logLevel)
NetworkUtils module (Pcap++)
Definition: Logger.h:72
SSLLayer module (Packet++)
Definition: Logger.h:49
TcpLayer module (Packet++)
Definition: Logger.h:40
KniDevice module (Pcap++)
Definition: Logger.h:71
GreLayer module (Packet++)
Definition: Logger.h:48
WinPcapLiveDevice module (Pcap++)
Definition: Logger.h:64
WinPcapRemoteDevice module (Pcap++)
Definition: Logger.h:65
void setAllModlesToLogLevel(LogLevel level)
Definition: Logger.h:150
TcpReassembly module (Packet++)
Definition: Logger.h:60
Layer module (Packet++)
Definition: Logger.h:34
ArpLayer module (Packet++)
Definition: Logger.h:35
EthLayer module (Packet++)
Definition: Logger.h:36
void enableLogs()
Definition: Logger.h:176
void resetLogPrinter()
Definition: Logger.h:161
UdpLayer module (Packet++)
Definition: Logger.h:41
GtpLayer module (Packet++)
Definition: Logger.h:58
PPPoELayer module (Packet++)
Definition: Logger.h:44
DhcpLayer module (Packet++)
Definition: Logger.h:51
void(* LogPrinter)(LogLevel logLevel, const std::string &logMessage, const std::string &file, const std::string &method, const int line)
Definition: Logger.h:116
IPv6Layer module (Packet++)
Definition: Logger.h:38
void suppressLogs()
Definition: Logger.h:171
Debug log level.
Definition: Logger.h:104
Table printer module (Common++)
Definition: Logger.h:30