aboutsummaryrefslogtreecommitdiffstats
path: root/libtransport
diff options
context:
space:
mode:
authorMauro Sardara <msardara@cisco.com>2019-04-18 14:54:54 +0200
committerMauro Sardara <msardara@cisco.com>2019-04-18 15:00:55 +0200
commit981cbc60271d794b1d9157ef0134ee4dfc362046 (patch)
tree8e6940358eb86a1e11a032d505aa3fb6ed20920d /libtransport
parent564dfea33b993c3ff6572894ef35f91ba37d23ed (diff)
[HICN-97] Add options for enable/disable log in libtransport.
Change-Id: I280c2022444f388a7d9eeb6d34db9d8f59807d9e Signed-off-by: Mauro Sardara <msardara@cisco.com>
Diffstat (limited to 'libtransport')
-rw-r--r--libtransport/CMakeLists.txt13
-rw-r--r--libtransport/src/hicn/transport/CMakeLists.txt3
2 files changed, 14 insertions, 2 deletions
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 ()