Commit 120ca9ab authored by Guillaume Pasero's avatar Guillaume Pasero

ENH: LibSVM silent unless OTB_SHOW_ALL_MSG_DEBUG is on

parent 16e6a638
......@@ -48,6 +48,9 @@ namespace Utils
return s.str();
}
/** Function that prints nothing (usefull to disable libsvm logs)*/
void OTBCommon_EXPORT PrintNothing(const char *s);
}
} // namespace otb
......
......@@ -37,6 +37,10 @@ bool IsLonLatValid(double lon, double lat)
return true;
}
void PrintNothing(const char * /* s */)
{
}
}
}
......@@ -26,6 +26,7 @@
#include "otbSVMCrossValidationCostFunction.h"
#include "otbExhaustiveExponentialOptimizer.h"
#include "otbMacro.h"
#include "otbUtils.h"
namespace otb
{
......@@ -65,6 +66,9 @@ LibSVMMachineLearningModel<TInputValue,TOutputValue>
this->m_Problem.l = 0;
this->m_Problem.y = ITK_NULLPTR;
this->m_Problem.x = ITK_NULLPTR;
#ifndef OTB_SHOW_ALL_MSG_DEBUG
svm_set_print_string_function(&otb::Utils::PrintNothing);
#endif
}
template <class TInputValue, class TOutputValue>
......
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