LoggingΒΆ

ecBuild provides functions for logging based on a log level set by the user, similar to the Python logging module:

ecbuild_debug:logs a STATUS message if log level <= DEBUG
ecbuild_info:logs a STATUS message if log level <= INFO
ecbuild_warn:logs a WARNING message if log level <= WARN
ecbuild_error:logs a SEND_ERROR message if log level <= ERROR
ecbuild_critical:
 logs a FATAL_ERROR message if log level <= CRITICAL
ecbuild_deprecate:
 logs a DEPRECATION message as a warning enable CMAKE_ERROR_DEPRECATED to raise an error instead disable CMAKE_WARN_DEPRECATED to hide deprecations

Furthermore there are auxilliary functions for outputting CMake variables, CMake lists and environment variables if the log level is DEBUG:

ecbuild_debug_var:
 logs given CMake variables if log level <= DEBUG
ecbuild_debug_list:
 logs given CMake lists if log level <= DEBUG
ecbuild_debug_env_var:
 logs given environment variables if log level <= DEBUG
ecbuild_debug_property:
 logs given global CMake property if log level <= DEBUG