From dd248303d3ccb282b4e7e13ae1fa0f181181cabd Mon Sep 17 00:00:00 2001 From: Pavel Odintsov Date: Sun, 24 May 2020 13:12:21 +0100 Subject: [PATCH] Unified log4cpp headers and suppressed deprecation errors. Closes #805 --- src/afpacket_plugin/afpacket_collector.cpp | 10 +--------- src/all_logcpp_libraries.h | 19 +++++++++++++++++++ src/example_plugin/example_collector.cpp | 10 +--------- src/fast_library.cpp | 9 +-------- src/fastnetmon.cpp | 13 +------------ src/fastnetmon_actions.h | 9 +-------- src/netflow_plugin/netflow_collector.cpp | 10 +--------- src/netmap_plugin/netmap_collector.cpp | 10 +--------- src/pcap_plugin/pcap_collector.cpp | 10 +--------- src/sflow_plugin/sflow_collector.cpp | 10 +--------- 10 files changed, 28 insertions(+), 82 deletions(-) create mode 100644 src/all_logcpp_libraries.h diff --git a/src/afpacket_plugin/afpacket_collector.cpp b/src/afpacket_plugin/afpacket_collector.cpp index f54972af..5b2ed5d6 100644 --- a/src/afpacket_plugin/afpacket_collector.cpp +++ b/src/afpacket_plugin/afpacket_collector.cpp @@ -1,12 +1,4 @@ -// log4cpp logging facility -#include "log4cpp/Appender.hh" -#include "log4cpp/BasicLayout.hh" -#include "log4cpp/Category.hh" -#include "log4cpp/FileAppender.hh" -#include "log4cpp/Layout.hh" -#include "log4cpp/OstreamAppender.hh" -#include "log4cpp/PatternLayout.hh" -#include "log4cpp/Priority.hh" +#include "../all_logcpp_libraries.h" #include #include diff --git a/src/all_logcpp_libraries.h b/src/all_logcpp_libraries.h new file mode 100644 index 00000000..b0d27b92 --- /dev/null +++ b/src/all_logcpp_libraries.h @@ -0,0 +1,19 @@ +#ifdef __GNUC__ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wdeprecated" +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef __GNUC__ + #pragma GCC diagnostic pop +#endif diff --git a/src/example_plugin/example_collector.cpp b/src/example_plugin/example_collector.cpp index 9efb224c..06d2f5d7 100644 --- a/src/example_plugin/example_collector.cpp +++ b/src/example_plugin/example_collector.cpp @@ -1,12 +1,4 @@ -// log4cpp logging facility -#include "log4cpp/Appender.hh" -#include "log4cpp/BasicLayout.hh" -#include "log4cpp/Category.hh" -#include "log4cpp/FileAppender.hh" -#include "log4cpp/Layout.hh" -#include "log4cpp/OstreamAppender.hh" -#include "log4cpp/PatternLayout.hh" -#include "log4cpp/Priority.hh" +#include "../all_logcpp_libraries.h" // For support uint32_t, uint16_t #include diff --git a/src/fast_library.cpp b/src/fast_library.cpp index 23de84bf..d0f53a00 100644 --- a/src/fast_library.cpp +++ b/src/fast_library.cpp @@ -13,14 +13,7 @@ #include #include -#include "log4cpp/Appender.hh" -#include "log4cpp/BasicLayout.hh" -#include "log4cpp/Category.hh" -#include "log4cpp/FileAppender.hh" -#include "log4cpp/Layout.hh" -#include "log4cpp/OstreamAppender.hh" -#include "log4cpp/PatternLayout.hh" -#include "log4cpp/Priority.hh" +#include "all_logcpp_libraries.h" #include diff --git a/src/fastnetmon.cpp b/src/fastnetmon.cpp index 0866c718..09b97d55 100644 --- a/src/fastnetmon.cpp +++ b/src/fastnetmon.cpp @@ -89,18 +89,7 @@ #include -// log4cpp logging facility -#include "log4cpp/Appender.hh" -#include "log4cpp/BasicLayout.hh" -#include "log4cpp/Category.hh" -#include "log4cpp/FileAppender.hh" -#include "log4cpp/Layout.hh" -#include "log4cpp/OstreamAppender.hh" -#include "log4cpp/PatternLayout.hh" -#include "log4cpp/Priority.hh" -#include "log4cpp/RemoteSyslogAppender.hh" -#include "log4cpp/SyslogAppender.hh" - +#include "all_logcpp_libraries.h" // Boost libs #include diff --git a/src/fastnetmon_actions.h b/src/fastnetmon_actions.h index 615db76d..12c92e42 100644 --- a/src/fastnetmon_actions.h +++ b/src/fastnetmon_actions.h @@ -1,11 +1,4 @@ -#include "log4cpp/Appender.hh" -#include "log4cpp/BasicLayout.hh" -#include "log4cpp/Category.hh" -#include "log4cpp/FileAppender.hh" -#include "log4cpp/Layout.hh" -#include "log4cpp/OstreamAppender.hh" -#include "log4cpp/PatternLayout.hh" -#include "log4cpp/Priority.hh" +#include "all_logcpp_libraries.h" #include "fast_library.h" diff --git a/src/netflow_plugin/netflow_collector.cpp b/src/netflow_plugin/netflow_collector.cpp index 45461df0..c3798a3e 100644 --- a/src/netflow_plugin/netflow_collector.cpp +++ b/src/netflow_plugin/netflow_collector.cpp @@ -16,15 +16,7 @@ #include "../fast_library.h" #include "../ipfix_rfc.h" -// log4cpp logging facility -#include "log4cpp/Appender.hh" -#include "log4cpp/BasicLayout.hh" -#include "log4cpp/Category.hh" -#include "log4cpp/FileAppender.hh" -#include "log4cpp/Layout.hh" -#include "log4cpp/OstreamAppender.hh" -#include "log4cpp/PatternLayout.hh" -#include "log4cpp/Priority.hh" +#include "../all_logcpp_libraries.h" #ifdef ENABLE_LUA_HOOKS #include diff --git a/src/netmap_plugin/netmap_collector.cpp b/src/netmap_plugin/netmap_collector.cpp index d6f53ccc..151619a5 100644 --- a/src/netmap_plugin/netmap_collector.cpp +++ b/src/netmap_plugin/netmap_collector.cpp @@ -1,12 +1,4 @@ -// log4cpp logging facility -#include "log4cpp/Appender.hh" -#include "log4cpp/BasicLayout.hh" -#include "log4cpp/Category.hh" -#include "log4cpp/FileAppender.hh" -#include "log4cpp/Layout.hh" -#include "log4cpp/OstreamAppender.hh" -#include "log4cpp/PatternLayout.hh" -#include "log4cpp/Priority.hh" +#include "../all_logcpp_libraries.h" #include #include diff --git a/src/pcap_plugin/pcap_collector.cpp b/src/pcap_plugin/pcap_collector.cpp index 51f420f2..d2dbf213 100644 --- a/src/pcap_plugin/pcap_collector.cpp +++ b/src/pcap_plugin/pcap_collector.cpp @@ -17,15 +17,7 @@ #include #include -// log4cpp logging facility -#include "log4cpp/Appender.hh" -#include "log4cpp/BasicLayout.hh" -#include "log4cpp/Category.hh" -#include "log4cpp/FileAppender.hh" -#include "log4cpp/Layout.hh" -#include "log4cpp/OstreamAppender.hh" -#include "log4cpp/PatternLayout.hh" -#include "log4cpp/Priority.hh" +#include "../all_logcpp_libraries.h" #include "pcap_collector.h" diff --git a/src/sflow_plugin/sflow_collector.cpp b/src/sflow_plugin/sflow_collector.cpp index 27e1f28d..32a77aee 100644 --- a/src/sflow_plugin/sflow_collector.cpp +++ b/src/sflow_plugin/sflow_collector.cpp @@ -23,15 +23,7 @@ #include #include -// log4cpp logging facility -#include "log4cpp/Appender.hh" -#include "log4cpp/BasicLayout.hh" -#include "log4cpp/Category.hh" -#include "log4cpp/FileAppender.hh" -#include "log4cpp/Layout.hh" -#include "log4cpp/OstreamAppender.hh" -#include "log4cpp/PatternLayout.hh" -#include "log4cpp/Priority.hh" +#include "../all_logcpp_libraries.h" #ifdef ENABLE_LUA_HOOKS lua_State* sflow_lua_state = NULL;