summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEd Tanous <ed.tanous@intel.com>2018-03-16 23:53:05 +0300
committerEd Tanous <ed.tanous@intel.com>2018-04-22 21:13:44 +0300
commitac093318ac41bb5306d19d01824f79d0d3488840 (patch)
tree054480214b547cf142a557d97347ff299619d92f
parent6c23301557b872240683babe6ab75c423a39e263 (diff)
downloadbmcweb-ac093318ac41bb5306d19d01824f79d0d3488840.tar.xz
Disable logging when in release mode
This increases the performance of the webserver quite a bit. Change-Id: I20714d89163cf30c65afd18d16f4fd16c06824d5 Signed-off-by: Ed Tanous <ed.tanous@intel.com>
-rw-r--r--CMakeLists.txt13
-rw-r--r--crow/include/crow/settings.h6
-rw-r--r--src/crow_test.cpp2
3 files changed, 10 insertions, 11 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index aebd2e233a..3d6037c7ff 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -53,7 +53,7 @@ SET(CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_MINSIZEREL} ${SECURITY_FLAGS}")
# ranlib are wrappers around ar and ranlib which add the lto plugin to the
# command line.
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
- if(NOT CMAKE_BUILD_TYPE MATCHES DEBUG)
+ if(NOT CMAKE_BUILD_TYPE MATCHES Debug)
STRING(REGEX REPLACE "ar$" "gcc-ar" CMAKE_AR ${CMAKE_AR})
STRING(REGEX REPLACE "ranlib$" "gcc-ranlib" CMAKE_RANLIB ${CMAKE_RANLIB})
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -flto -fno-fat-lto-objects")
@@ -67,7 +67,7 @@ if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
-fvisibility-inlines-hidden \
-Wl,--exclude-libs,ALL"
)
- endif(NOT CMAKE_BUILD_TYPE MATCHES DEBUG)
+ endif(NOT CMAKE_BUILD_TYPE MATCHES Debug)
endif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
# add_definitions(-DBOOST_ASIO_ENABLE_HANDLER_TRACKING)
@@ -87,7 +87,14 @@ find_package(OpenSSL REQUIRED)
include_directories(${OPENSSL_INCLUDE_DIR})
message("OPENSSL_INCLUDE_DIR ${OPENSSL_INCLUDE_DIR}")
-# Crow add_definitions(-DCROW_DISABLE_LOGGING)
+# Crow
+message("CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}")
+if(CMAKE_BUILD_TYPE MATCHES Debug)
+ message("Logging disabled")
+ add_definitions(-DCROW_ENABLE_LOGGING)
+ add_definitions(-DCROW_ENABLE_DEBUG)
+endif(CMAKE_BUILD_TYPE MATCHES Debug)
+
add_definitions(-DCROW_ENABLE_SSL)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/crow/include)
diff --git a/crow/include/crow/settings.h b/crow/include/crow/settings.h
index 032c49bf87..9d29a998b9 100644
--- a/crow/include/crow/settings.h
+++ b/crow/include/crow/settings.h
@@ -2,12 +2,6 @@
// settings for crow
// TODO - replace with runtime config. libucl?
-/* #ifdef - enables debug mode */
-#define CROW_ENABLE_DEBUG
-
-/* #ifdef - enables logging */
-#define CROW_ENABLE_LOGGING
-
/* #ifdef - enables ssl */
//#define CROW_ENABLE_SSL
diff --git a/src/crow_test.cpp b/src/crow_test.cpp
index 942095d96f..a3c9ed9e0d 100644
--- a/src/crow_test.cpp
+++ b/src/crow_test.cpp
@@ -1,5 +1,3 @@
-//#define CROW_ENABLE_LOGGING
-#define CROW_ENABLE_DEBUG
#include <iostream>
#include <sstream>
#include <vector>