@@ -25,8 +25,8 @@ option(SUPPORT_TTL "whether support TTL" OFF)
2525option (OPT_SUPPORT_ZSTD_TRACE "whether support zstd trace" ON )
2626option (ENABLE_LRB "enable LRB" OFF )
2727option (ENABLE_3L_CACHE "enable 3LCache" OFF )
28- set (LOG_LEVEL NONE CACHE STRING "change the logging level" )
29- set_property (CACHE LOG_LEVEL PROPERTY STRINGS ERROR WARN INFO DEBUG VERBOSE )
28+ set (LOG_LEVEL "default" CACHE STRING "change the logging level" )
29+ set_property (CACHE LOG_LEVEL PROPERTY STRINGS ERROR WARN INFO DEBUG VERBOSE DEFAULT )
3030
3131# Platform detection
3232if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin" )
@@ -51,9 +51,15 @@ if(USE_HUGEPAGE)
5151 add_compile_definitions (USE_HUGEPAGE=1 )
5252endif ()
5353
54+ if (NOT CMAKE_BUILD_TYPE )
55+ # we can also consider RelWithDebInfo, but it will be too slow for release build
56+ set (CMAKE_BUILD_TYPE Release)
57+ endif ()
58+
59+
5460string (TOLOWER "${LOG_LEVEL} " LOG_LEVEL_LOWER)
5561
56- if (LOG_LEVEL_LOWER STREQUAL "none " )
62+ if (LOG_LEVEL_LOWER STREQUAL "default " )
5763 if (${CMAKE_BUILD_TYPE} MATCHES "Debug" )
5864 message (STATUS "LOG_LEVEL is not set, use DEBUG as default for debug build" )
5965 add_compile_definitions (LOGLEVEL=6 )
@@ -77,11 +83,6 @@ else()
7783endif ()
7884
7985
80- if (NOT CMAKE_BUILD_TYPE )
81- # we can also consider RelWithDebInfo, but it will be too slow for release build
82- set (CMAKE_BUILD_TYPE Release)
83- endif ()
84-
8586
8687# Define shared compiler flags for all targets
8788set (LIBCACHESIM_C_FLAGS
0 commit comments