1
0
Fork 0
mirror of https://github.com/pavel-odintsov/fastnetmon synced 2024-05-10 00:16:25 +02:00

Compare commits

...

3 Commits

Author SHA1 Message Date
Michael Cho 806a5533ed
Merge fad8757b89 into 907454df86 2024-01-08 16:44:41 -05:00
Pavel Odintsov 907454df86 Better logging 2024-01-08 11:40:07 +00:00
Michael Cho fad8757b89
Prioritize find_package config mode for Protobuf
This sets correct C++ standard for newer Protobuf installations as
FindProtobuf module only sets cxx_std_11
2023-12-26 12:56:45 -05:00
5 changed files with 16 additions and 16 deletions

View File

@ -594,26 +594,26 @@ if (ENABLE_GOBGP_SUPPORT)
target_link_libraries(gobgp_action absl::base absl::synchronization)
endif()
# By default use module supplied by cmake to search for Protobuf
set(FIND_PACKAGE_MODE_PROTOBUF "MODULE")
if (DO_NOT_USE_SYSTEM_LIBRARIES_FOR_BUILD)
# We add our custom path to Protobuf to top of search_list used by find_package: https://cmake.org/cmake/help/latest/variable/CMAKE_PREFIX_PATH.html
# This approach has advantage over Protobuf_DIR which requires us to set direct path to cmake folder of custom built dependency
# which resides in vendor specific folder with name lib which may be lib64 on CentOS platforms:
# protobuf_21_12/lib/cmake/protobuf or protobuf_21_12/lib64/cmake/protobuf on CentOS
list(APPEND CMAKE_PREFIX_PATH ${PROTOCOL_BUFFERS_CUSTOM_INSTALL_PATH})
# Switch to use to configuration supplied by custom Protobuf installation as it may be better
set(FIND_PACKAGE_MODE_PROTOBUF "CONFIG")
# Apparently it's required to set this flag because without this flag set it cannot find protoc when custom library path is in use
# https://github.com/protocolbuffers/protobuf/issues/1931
set(protobuf_MODULE_COMPATIBLE true)
endif()
# https://cmake.org/cmake/help/latest/module/FindProtobuf.html
find_package(Protobuf ${FIND_PACKAGE_MODE_PROTOBUF} REQUIRED)
# Apparently it's required to set this flag because without this flag set it cannot find protoc when custom library path is in use
# https://github.com/protocolbuffers/protobuf/issues/1931
set(protobuf_MODULE_COMPATIBLE true)
# Switch to use to configuration supplied by custom Protobuf installation as it may be better
find_package(Protobuf CONFIG)
if (NOT Protobuf_FOUND)
# Fall back to module supplied by cmake to search for Protobuf
# https://cmake.org/cmake/help/latest/module/FindProtobuf.html
find_package(Protobuf MODULE REQUIRED)
endif()
if (Protobuf_FOUND)
message(STATUS "Found Protobuf ${Protobuf_VERSION}")

View File

@ -1413,7 +1413,7 @@ void init_logging(bool log_to_console) {
logger.addAppender(appender);
}
logger << log4cpp::Priority::INFO << "Logger initialized!";
logger << log4cpp::Priority::INFO << "Logger initialized";
}
void reconfigure_logging_level(const std::string& logging_level) {

View File

@ -63,7 +63,7 @@ void init_logging() {
logger.setPriority(log4cpp::Priority::INFO);
logger.addAppender(appender);
logger.info("Logger initialized!");
logger.info("Logger initialized");
}
void pcap_parse_packet(const char* flow_type, char* buffer, uint32_t len);

View File

@ -66,7 +66,7 @@ void init_logging() {
logger.setPriority(log4cpp::Priority::INFO);
logger.addAppender(appender);
logger.info("Logger initialized!");
logger.info("Logger initialized");
}
void process_packet(simple_packet& current_packet) {

View File

@ -74,7 +74,7 @@ void init_logging() {
logger.setPriority(log4cpp::Priority::INFO);
logger.addAppender(appender);
logger.info("Logger initialized!");
logger.info("Logger initialized");
}
uint64_t received_packets = 0;