opm-common
EclipsePRTLog.hpp
1 /*
2  Copyright 2016 Statoil ASA.
3 
4  This file is part of the Open Porous Media project (OPM).
5 
6  OPM is free software: you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation, either version 3 of the License, or
9  (at your option) any later version.
10 
11  OPM is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with OPM. If not, see <http://www.gnu.org/licenses/>.
18 */
19 
20 #ifndef ECLIPSEPRTLOG_H
21 #define ECLIPSEPRTLOG_H
22 
23 #include <opm/common/OpmLog/StreamLog.hpp>
24 
25 #include <cstddef>
26 #include <cstdint>
27 #include <map>
28 #include <string>
29 
30 namespace Opm {
31 
32 class EclipsePRTLog : public StreamLog {
33 
34 public:
35  using StreamLog::StreamLog;
36 
37  std::size_t numMessages(std::int64_t messageType) const;
38 
39  ~EclipsePRTLog() override;
40 
47  EclipsePRTLog(const std::string& logFile , std::int64_t messageMask,
48  bool append, bool print_summary);
49 
54  EclipsePRTLog(std::ostream& os, std::int64_t messageMask,
55  bool print_summary);
56 
57 protected:
58  void addMessageUnconditionally(std::int64_t messageType, const std::string& message) override;
59 
60 private:
61  std::map<std::int64_t, std::size_t> m_count;
63  bool print_summary_ = true;
64 };
65 }
66 #endif // ECLIPSEPRTLOG_H
Definition: StreamLog.hpp:30
void addMessageUnconditionally(std::int64_t messageType, const std::string &message) override
This is the method subclasses should override.
Definition: EclipsePRTLog.cpp:28
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition: Exceptions.hpp:30
Definition: EclipsePRTLog.hpp:32
EclipsePRTLog(const std::string &logFile, std::int64_t messageMask, bool append, bool print_summary)
Construct a logger to the <MODEL>.PRT file.
Definition: EclipsePRTLog.cpp:64