Commit f22028c7 authored by Antoine Regimbeau's avatar Antoine Regimbeau

ENH: allow setting on windows with ""

parent bcd81b27
Pipeline #218 passed with stage
in 29 minutes and 9 seconds
......@@ -71,8 +71,13 @@ itk::LoggerBase::PriorityLevelType ConfigurationManager::GetLoggerLevel()
// Default value is INFO
itk::LoggerBase::PriorityLevelType level = itk::LoggerBase::INFO;
if(itksys::SystemTools::GetEnv("OTB_LOGGER_LEVEL",svalue))
itksys::SystemTools::GetEnv("OTB_LOGGER_LEVEL",svalue);
// on windows a variable set with set EX="" will keep the "". We need
// to remove them.
svalue = svalue.substr( svalue.find_first_not_of("\"") ,
svalue.find_last_not_of("\""));
if( !svalue.empty() )
{
if(svalue.compare("DEBUG") == 0)
{
......@@ -92,7 +97,9 @@ itk::LoggerBase::PriorityLevelType ConfigurationManager::GetLoggerLevel()
}
else
{
otbLogMacro(Error,<<"Unknown value for OTB_LOGGER_LEVEL_MACRO. Possible values are DEBUG, INFO, WARNING, CRITICAL.");
otbLogMacro(Warning,<<"Unknown value for OTB_LOGGER_LEVEL_MACRO ("
<<svalue<<"). Possible values are DEBUG, INFO, WARNING, CRITICAL. "
<<"Level set to INFO.");
}
}
return level;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment