diff --git a/opm/common/OpmLog/StreamLog.cpp b/opm/common/OpmLog/StreamLog.cpp index 6813cb4cb..556856ae8 100644 --- a/opm/common/OpmLog/StreamLog.cpp +++ b/opm/common/OpmLog/StreamLog.cpp @@ -22,9 +22,13 @@ namespace Opm { -StreamLog::StreamLog(const std::string& logFile , int64_t messageMask) : LogBackend(messageMask) +StreamLog::StreamLog(const std::string& logFile , int64_t messageMask, bool append) : LogBackend(messageMask) { - m_ofstream.open( logFile.c_str() , std::ofstream::out ); + if (append) { + m_ofstream.open( logFile.c_str() , std::ofstream::app ); + } else { + m_ofstream.open( logFile.c_str() , std::ofstream::out ); + } m_streamOwner = true; m_ostream = &m_ofstream; } diff --git a/opm/common/OpmLog/StreamLog.hpp b/opm/common/OpmLog/StreamLog.hpp index fc6c5467f..9e4048de4 100644 --- a/opm/common/OpmLog/StreamLog.hpp +++ b/opm/common/OpmLog/StreamLog.hpp @@ -31,7 +31,7 @@ namespace Opm { class StreamLog : public LogBackend { public: - StreamLog(const std::string& logFile , int64_t messageMask); + StreamLog(const std::string& logFile , int64_t messageMask, bool append = false); StreamLog(std::ostream& os , int64_t messageMask); virtual void addTaggedMessage(int64_t messageType, const std::string& messageTag, const std::string& message) override; ~StreamLog();