From 4091ced5aba3224fa72ffe077b93bc003ec7e298 Mon Sep 17 00:00:00 2001 From: Alexander Alekhin Date: Tue, 5 Jun 2018 12:40:43 +0300 Subject: [PATCH] core: set default logger level to 'warning' in Release builds should hide unnecessary 'info' messages --- modules/core/src/logger.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/modules/core/src/logger.cpp b/modules/core/src/logger.cpp index b6c076e2b5..e7c6669242 100644 --- a/modules/core/src/logger.cpp +++ b/modules/core/src/logger.cpp @@ -21,7 +21,13 @@ namespace logging { static LogLevel parseLogLevelConfiguration() { - static cv::String param_log_level = utils::getConfigurationParameterString("OPENCV_LOG_LEVEL", "INFO"); + static cv::String param_log_level = utils::getConfigurationParameterString("OPENCV_LOG_LEVEL", +#if defined NDEBUG + "WARNING" +#else + "INFO" +#endif + ); if (param_log_level == "DISABLED" || param_log_level == "disabled" || param_log_level == "0" || param_log_level == "OFF" || param_log_level == "off") return LOG_LEVEL_SILENT;