Also set debug level in OpmLog and avoid test failures in DeferredLoggger

This commit is contained in:
Vegard Kippe committed 2025-06-24 14:26:12 +02:00
1 parent 19cd4698d8
commit 947895c27f
3 files changed
+12 -2

No files matched your search

+5
View File
@@ -32,6 +32,8 @@
#include <opm/simulators/flow/FlowMain.hpp>
#include <opm/simulators/flow/FlowProblemBlackoil.hpp>
#include <opm/simulators/utils/DeferredLogger.hpp>
#if HAVE_DUNE_FEM
#include <dune/fem/misc/mpimanager.hh>
#else
@@ -212,6 +214,9 @@ protected:
exitCode = (status > 0) ? status : EXIT_SUCCESS;
return false; // Whether to run the simulator
}
const int debug_level = Parameters::Get<Parameters::DebugLevel>();
OpmLog::setDebugLevel(debug_level);
DeferredLogger::setGlobalDebugLevel(debug_level);
std::string deckFilename;
std::string outputDir;
+3 -2
View File
@@ -20,12 +20,13 @@
#include <config.h>
#include <opm/simulators/utils/DeferredLogger.hpp>
#include <opm/common/OpmLog/OpmLog.hpp>
#include <opm/simulators/flow/FlowMain.hpp>
namespace Opm
{
int DeferredLogger::global_debug_level_ = 0;
DeferredLogger::DeferredLogger()
: debug_level_(Parameters::Get<Parameters::DebugLevel>())
: debug_level_(global_debug_level_)
{}
+4
View File
@@ -83,6 +83,9 @@ enum ExcEnum {
int getDebugLevel() const { return this->debug_level_; }
void setDebugLevel(const int level) { this->debug_level_ = level; }
static int getGlobalDebugLevel() { return global_debug_level_; }
static void setGlobalDebugLevel(const int level) { global_debug_level_ = level; }
/// Log all messages to the OpmLog backends,
/// and clear the message container.
@@ -94,6 +97,7 @@ enum ExcEnum {
private:
std::vector<Message> messages_;
int debug_level_ {0};
static int global_debug_level_;
friend DeferredLogger gatherDeferredLogger(const DeferredLogger& local_deferredlogger,
Parallel::Communication mpi_communicator);
};