Allow disabling output in EclipsePRTLog.
In a parallel run we need to be able to disable output in EclipsePRTLog as only one process is allowed to output messages. This commit adds a new defaulted constructor parameter to allow this.
This commit is contained in:
parent
37938bbf5e
commit
64c0651ffa
@ -45,6 +45,11 @@ namespace Opm {
|
||||
|
||||
EclipsePRTLog::~EclipsePRTLog()
|
||||
{
|
||||
if( ! print_summary_ )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
//output summary.
|
||||
const std::string summary_msg = "\n\nError summary:" +
|
||||
std::string("\nWarnings " + std::to_string(numMessages(Log::MessageType::Warning))) +
|
||||
@ -56,4 +61,14 @@ namespace Opm {
|
||||
StreamLog::addTaggedMessage(Log::MessageType::Info, "", summary_msg);
|
||||
}
|
||||
|
||||
EclipsePRTLog::EclipsePRTLog(const std::string& logFile , int64_t messageMask,
|
||||
bool append, bool print_summary)
|
||||
: StreamLog(logFile, messageMask, append),
|
||||
print_summary_(print_summary)
|
||||
{}
|
||||
|
||||
EclipsePRTLog::EclipsePRTLog(std::ostream& os , int64_t messageMask,
|
||||
bool print_summary)
|
||||
: StreamLog(os, messageMask), print_summary_(print_summary)
|
||||
{}
|
||||
}
|
||||
|
@ -29,7 +29,6 @@ namespace Opm {
|
||||
class EclipsePRTLog : public StreamLog {
|
||||
|
||||
public:
|
||||
using StreamLog::StreamLog;
|
||||
|
||||
void addTaggedMessage(int64_t messageType, const std::string& messageTag, const std::string& message);
|
||||
|
||||
@ -37,8 +36,14 @@ public:
|
||||
|
||||
~EclipsePRTLog();
|
||||
|
||||
EclipsePRTLog(const std::string& logFile , int64_t messageMask,
|
||||
bool append, bool print_summary=true);
|
||||
|
||||
EclipsePRTLog(std::ostream& os , int64_t messageMask,
|
||||
bool print_summary=true);
|
||||
private:
|
||||
std::map<int64_t, size_t> m_count;
|
||||
bool print_summary_;
|
||||
};
|
||||
}
|
||||
#endif // ECLIPSEPRTLOG_H
|
||||
|
Loading…
Reference in New Issue
Block a user