From 981cbc60271d794b1d9157ef0134ee4dfc362046 Mon Sep 17 00:00:00 2001 From: Mauro Sardara Date: Thu, 18 Apr 2019 14:54:54 +0200 Subject: [HICN-97] Add options for enable/disable log in libtransport. Change-Id: I280c2022444f388a7d9eeb6d34db9d8f59807d9e Signed-off-by: Mauro Sardara --- libtransport/CMakeLists.txt | 13 +++++++++++++ libtransport/src/hicn/transport/CMakeLists.txt | 3 +-- 2 files changed, 14 insertions(+), 2 deletions(-) (limited to 'libtransport') diff --git a/libtransport/CMakeLists.txt b/libtransport/CMakeLists.txt index 131067888..1cc4c3539 100644 --- a/libtransport/CMakeLists.txt +++ b/libtransport/CMakeLists.txt @@ -29,6 +29,19 @@ if (NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE "Release") endif () +######################################### +# LOG LEVELS AVAILABLE +# VERBOSE +# DEBUG +# INFO +# WARN +# ERROR +# FATAL +# NONE +# +# Default: INFO +set(TRANSPORT_LOG_LEVEL "INFO" CACHE STRING "Set log level") + set(TRANSPORT_ROOT_PATH "src/hicn/transport") set(TRANSPORT_CORE ${TRANSPORT_ROOT_PATH}/core) diff --git a/libtransport/src/hicn/transport/CMakeLists.txt b/libtransport/src/hicn/transport/CMakeLists.txt index 4314ef908..4c0982c58 100644 --- a/libtransport/src/hicn/transport/CMakeLists.txt +++ b/libtransport/src/hicn/transport/CMakeLists.txt @@ -30,14 +30,13 @@ install( COMPONENT lib${LIBTRANSPORT}-dev ) -set (COMPILER_DEFINITIONS "") +set (COMPILER_DEFINITIONS "-DTRANSPORT_LOG_DEF_LEVEL=TRANSPORT_LOG_${TRANSPORT_LOG_LEVEL}") list(INSERT LIBTRANSPORT_INCLUDE_DIRS 0 ${CMAKE_CURRENT_SOURCE_DIR}/../.. ${CMAKE_CURRENT_BINARY_DIR}/../.. ) - if (NOT WIN32) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread") else () -- cgit 1.2.3-korg