mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Allow a flow_ebos run without creating a debug or prt file.
Adds two switches no_prt_log, and no_debug_log that deactivate writing to PRT and DEBUG file. One can now run flow_ebos without creating any output by passing "output=false no_prt_log=true no_debug_log=true" on the command line.
This commit is contained in:
parent
56cef57c8d
commit
588111d135
@ -282,15 +282,25 @@ namespace Opm
|
||||
logFileStream << ".PRT";
|
||||
debugFileStream << ".DEBUG";
|
||||
|
||||
std::string debugFile = debugFileStream.str();
|
||||
logFile_ = logFileStream.str();
|
||||
|
||||
std::shared_ptr<EclipsePRTLog> prtLog = std::make_shared<EclipsePRTLog>(logFile_ , Log::NoDebugMessageTypes, false, output_cout_);
|
||||
if( ! param_.getDefault("no_prt_log", false) )
|
||||
{
|
||||
std::shared_ptr<EclipsePRTLog> prtLog = std::make_shared<EclipsePRTLog>(logFile_ , Log::NoDebugMessageTypes, false, output_cout_);
|
||||
OpmLog::addBackend( "ECLIPSEPRTLOG" , prtLog );
|
||||
prtLog->setMessageLimiter(std::make_shared<MessageLimiter>());
|
||||
prtLog->setMessageFormatter(std::make_shared<SimpleMessageFormatter>(false));
|
||||
}
|
||||
|
||||
if( ! param_.getDefault("no_debug_log", false) )
|
||||
{
|
||||
std::string debugFile = debugFileStream.str();
|
||||
std::shared_ptr<StreamLog> debugLog = std::make_shared<EclipsePRTLog>(debugFile, Log::DefaultMessageTypes, false, output_cout_);
|
||||
OpmLog::addBackend( "DEBUGLOG" , debugLog);
|
||||
}
|
||||
|
||||
std::shared_ptr<StreamLog> streamLog = std::make_shared<StreamLog>(std::cout, Log::StdoutMessageTypes);
|
||||
OpmLog::addBackend( "ECLIPSEPRTLOG" , prtLog );
|
||||
OpmLog::addBackend( "STREAMLOG", streamLog);
|
||||
std::shared_ptr<StreamLog> debugLog = std::make_shared<EclipsePRTLog>(debugFile, Log::DefaultMessageTypes, false, output_cout_);
|
||||
OpmLog::addBackend( "DEBUGLOG" , debugLog);
|
||||
const auto& msgLimits = eclState().getSchedule().getMessageLimits();
|
||||
const std::map<int64_t, int> limits = {{Log::MessageType::Note, msgLimits.getCommentPrintLimit(0)},
|
||||
{Log::MessageType::Info, msgLimits.getMessagePrintLimit(0)},
|
||||
@ -298,8 +308,6 @@ namespace Opm
|
||||
{Log::MessageType::Error, msgLimits.getErrorPrintLimit(0)},
|
||||
{Log::MessageType::Problem, msgLimits.getProblemPrintLimit(0)},
|
||||
{Log::MessageType::Bug, msgLimits.getBugPrintLimit(0)}};
|
||||
prtLog->setMessageLimiter(std::make_shared<MessageLimiter>());
|
||||
prtLog->setMessageFormatter(std::make_shared<SimpleMessageFormatter>(false));
|
||||
streamLog->setMessageLimiter(std::make_shared<MessageLimiter>(10, limits));
|
||||
streamLog->setMessageFormatter(std::make_shared<SimpleMessageFormatter>(true));
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user