File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed
Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change 11include (CMakeDependentOption)
22
33# Project build options
4- option (LSL_DEBUGLOG "Enable (lots of) additional debug messages" OFF )
4+ # Default LSL_DEBUGLOG to ON for Debug builds (single-config generators only)
5+ string (COMPARE EQUAL "${CMAKE_BUILD_TYPE} " "Debug" _LSL_DEBUGLOG_DEFAULT)
6+ option (LSL_DEBUGLOG "Enable (lots of) additional debug messages" ${_LSL_DEBUGLOG_DEFAULT} )
57option (LSL_UNIXFOLDERS "Use the unix folder layout for install targets" ON )
68option (LSL_BUILD_STATIC "Build LSL as a static library." OFF )
79option (LSL_FRAMEWORK "Build LSL as an Apple Framework (Mac only)" ON )
Original file line number Diff line number Diff line change @@ -94,7 +94,12 @@ void api_config::load_from_file(const std::string &filename) {
9494 }
9595
9696 // read the [log] settings
97- int log_level = pt.get (" log.level" , (int )loguru::Verbosity_INFO);
97+ #if LOGURU_DEBUG_LOGGING
98+ // When built with LSL_DEBUGLOG=ON, default to verbose logging
99+ int log_level = pt.get (" log.level" , 1 );
100+ #else
101+ int log_level = pt.get (" log.level" , static_cast <int >(loguru::Verbosity_INFO));
102+ #endif
98103 if (log_level < -3 || log_level > 9 )
99104 throw std::runtime_error (" Invalid log.level (valid range: -3 to 9" );
100105
You can’t perform that action at this time.
0 commit comments