%{
#include "KernelBasis.hxx"
#include "HeatMarcel.hxx"
+#include "libSALOMELog.hxx"
using namespace SALOME;
%}
double GetTimeAdjustmentCst();
+bool VerbosityActivated();
+
+void SetVerbosityActivated(bool flag);
+
+
%inline
{
PyObject *HeatMarcelSwig(double timeAjustment, unsigned int nbThreads = 0)
#include <string>
#include <iostream>
+enum class VerbosityMode { undefined, nolog, withlog };
+
+static VerbosityMode isActivated = VerbosityMode::undefined;
+
namespace SALOME
{
bool VerbosityActivated()
{
- auto isEnvVarSet = []() -> bool
+ auto isEnvVarSet = []() -> VerbosityMode
{
const char* envVar = std::getenv("SALOME_VERBOSE");
try
{
const long long numValue = std::stoll(envVar);
- return numValue > 0;
+ return numValue > 0?VerbosityMode::withlog:VerbosityMode::nolog;
}
catch(const std::exception& e)
{
}
}
- return false;
+ return VerbosityMode::nolog;
};
- static const bool isActivated = isEnvVarSet();
- return isActivated;
+ if(isActivated == VerbosityMode::undefined)
+ isActivated = isEnvVarSet();
+ return isActivated == VerbosityMode::withlog;
+ }
+
+ void SetVerbosityActivated(bool flag)
+ {
+ isActivated = flag ? VerbosityMode::withlog:VerbosityMode::nolog;
}
}