From ee7eac625a07220b53ed74fa4e555f23ad7a831a Mon Sep 17 00:00:00 2001 From: Julien Michel <julien.michel@cnes.fr> Date: Tue, 13 Mar 2018 14:41:59 +0100 Subject: [PATCH] ENH: Change default level to INFO whatever compilation options --- Documentation/Cookbook/rst/AdvancedUse.rst | 2 +- Modules/Core/Common/include/otbConfigurationManager.h | 3 +-- Modules/Core/Common/src/otbConfigurationManager.cxx | 6 +----- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/Documentation/Cookbook/rst/AdvancedUse.rst b/Documentation/Cookbook/rst/AdvancedUse.rst index d985193932..604380e57a 100644 --- a/Documentation/Cookbook/rst/AdvancedUse.rst +++ b/Documentation/Cookbook/rst/AdvancedUse.rst @@ -14,7 +14,7 @@ those values. * ``OTB_DEM_DIRECTORY``: Default directory were DEM tiles are stored. It should only contain ```.hgt`` or or georeferenced ``.tif`` files. Empty if not set (no directory set) * ``OTB_GEOID_FILE``: Default path to the geoid file that will be used to retrieve height of DEM above ellipsoid. Empty if not set (no geoid set) * ``OTB_MAX_RAM_HINT``: Default maximum memory that OTB should use for processing, in MB. If not set, default value is 128 MB. -* ``OTB_LOGGER_LEVEL``: Default level of logging for OTB. Should be one of ``DEBUG``, ``INFO``, ``WARNING``, ``CRITICAL`` or ``FATAL``, by increasing order of priority. Only messages with a higher priority than the level of logging will be displayed. By default level is ``DEBUG`` for Debug build and ``INFO`` otherwise. +* ``OTB_LOGGER_LEVEL``: Default level of logging for OTB. Should be one of ``DEBUG``, ``INFO``, ``WARNING``, ``CRITICAL`` or ``FATAL``, by increasing order of priority. Only messages with a higher priority than the level of logging will be displayed. If not set, default level is ``INFO``. Extended filenames ------------------ diff --git a/Modules/Core/Common/include/otbConfigurationManager.h b/Modules/Core/Common/include/otbConfigurationManager.h index 0c6b9118ae..71e45fe727 100644 --- a/Modules/Core/Common/include/otbConfigurationManager.h +++ b/Modules/Core/Common/include/otbConfigurationManager.h @@ -99,8 +99,7 @@ public: * be displayed. * * By default (if OTB_LOGGER_LEVEL is not set or can not be - * decoded), level is DEBUG in Debug or RelWithDebInfo builds, and - * INFO otherwise. + * decoded), level is INFO. * */ static itk::LoggerBase::PriorityLevelType GetLoggerLevel(); diff --git a/Modules/Core/Common/src/otbConfigurationManager.cxx b/Modules/Core/Common/src/otbConfigurationManager.cxx index 6e4819539d..d12d183362 100644 --- a/Modules/Core/Common/src/otbConfigurationManager.cxx +++ b/Modules/Core/Common/src/otbConfigurationManager.cxx @@ -69,12 +69,8 @@ itk::LoggerBase::PriorityLevelType ConfigurationManager::GetLoggerLevel() { std::string svalue; - #ifndef NDEBUG - itk::LoggerBase::PriorityLevelType level = itk::LoggerBase::DEBUG; - #else + // Default value is INFO itk::LoggerBase::PriorityLevelType level = itk::LoggerBase::INFO; - #endif - if(itksys::SystemTools::GetEnv("OTB_LOGGER_LEVEL",svalue)) { -- GitLab