Updated the log level documentation

Signed-off-by: Fabian Sauter <sauter.fabian@mailbox.org>
This commit is contained in:
Fabian Sauter 2022-07-12 09:39:14 +02:00
parent 6f0916d325
commit 7bdde2e6f1
3 changed files with 6 additions and 8 deletions

View file

@ -82,7 +82,7 @@ kompute_option(KOMPUTE_OPT_INSTALL "Enable if you want to enable installation."
# Build options
kompute_option(KOMPUTE_OPT_BUILD_PYTHON "Enable if you want to build python bindings." OFF)
kompute_log_level(KOMPUTE_OPT_LOG_LEVEL "Internally we use spdlog for logging. The log level used can be changed here." "Default")
kompute_log_level(KOMPUTE_OPT_LOG_LEVEL "Internally we use spdlog for logging. The log level used can be changed here. Possible values: 'Trace', 'Debug', 'Info', 'Warn', 'Error', 'Critical', 'Off', 'Default'. If set to 'Off' spdlog will be deactivated completely. If set to 'Default', the log level will be set to 'Info' for release builds and 'Debug' else." "Default")
kompute_option(KOMPUTE_OPT_ANDROID_BUILD "Enable android compilation flags required." OFF)
kompute_option(KOMPUTE_OPT_DISABLE_VK_DEBUG_LAYERS "Explicitly disable debug layers even on debug." OFF)
kompute_option(KOMPUTE_OPT_DISABLE_VULKAN_VERSION_CHECK "Whether to check if your driver supports the Vulkan Header version you are linking against. This might be useful in case you build shared on a different system than you run later." OFF)

View file

@ -37,7 +37,7 @@ This by default configures without any of the extra build tasks (such as buildin
* - -DKOMPUTE_OPT_BUILD_PYTHON=ON
- Enable if you want to build python bindings.
* - -DKOMPUTE_OPT_LOG_LEVEL="Trace"
- Internally we use spdlog for logging. The log level used can be changed here.
- Internally we use spdlog for logging. The log level used can be changed here. Possible values: 'Trace', 'Debug', 'Info', 'Warn', 'Error', 'Critical', 'Off', 'Default'. If set to 'Off' spdlog will be deactivated completely. If set to 'Default', the log level will be set to 'Info' for release builds and 'Debug' else.
* - -DKOMPUTE_OPT_ANDROID_BUILD=ON
- Enable android compilation flags required.
* - -DKOMPUTE_OPT_DISABLE_VK_DEBUG_LAYERS=ON

View file

@ -23,16 +23,14 @@ elseif(${KOMPUTE_OPT_LOG_LEVEL} STREQUAL "Error")
elseif(${KOMPUTE_OPT_LOG_LEVEL} STREQUAL "Critical")
set(KOMPUTE_OPT_LOG_LEVEL CRITICAL)
message(STATUS "Using log level Critical")
elseif(${KOMPUTE_OPT_LOG_LEVEL} STREQUAL Off)
elseif(${KOMPUTE_OPT_LOG_LEVEL} STREQUAL "Off")
set(KOMPUTE_OPT_LOG_LEVEL OFF)
message(STATUS "Using log level Off")
else()
if((NOT ${KOMPUTE_OPT_LOG_LEVEL} STREQUAL Default) AND(NOT KOMPUTE_OPT_LOG_LEVEL STREQUAL ""))
message(WARNING "Log level '${KOMPUTE_OPT_LOG_LEVEL}' unknown, use -DKOMPUTE_OPT_LOG_LEVEL=[Trace, Debug, Info, Warn, Error, Critical, Off]")
endif()
elseif(${KOMPUTE_OPT_LOG_LEVEL} STREQUAL "Default")
set(KOMPUTE_OPT_LOG_LEVEL $<IF:$<CONFIG:Debug>,DEBUG,INFO>)
message(STATUS "Setting KOMPUTE_OPT_LOG_LEVEL to according to build type")
else()
message(FATAL_ERROR "Log level '${KOMPUTE_OPT_LOG_LEVEL}' unknown, use -DKOMPUTE_OPT_LOG_LEVEL={Trace, Debug, Info, Warn, Error, Critical, Off, Default} to set it to a correct value.")
endif()
target_compile_definitions(kp_logger INTERFACE SPDLOG_ACTIVE_LEVEL=SPDLOG_LEVEL_${KOMPUTE_OPT_LOG_LEVEL})