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>
diff --git a/CMakeLists.txt b/CMakeLists.txt
index aebd2e2..3d6037c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -53,7 +53,7 @@
 # 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 @@
         -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 @@
 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 032c49b..9d29a99 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 942095d..a3c9ed9 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>