LogUtil.hpp
Go to the documentation of this file.
1 /*
2  Copyright 2015 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 OPM_LOG_UTIL_HPP
21 #define OPM_LOG_UTIL_HPP
22 
23 #include <cstdint>
24 #include <string>
25 
26 namespace Opm {
27 namespace Log {
28  namespace MessageType {
29  const int64_t Debug = 1; /* Excessive information */
30  const int64_t Info = 2; /* Normal status information */
31  const int64_t Warning = 4; /* Input anomaly - possible error */
32  const int64_t Error = 8; /* Error in the input data - should probably exit. */
33  const int64_t Problem = 16; /* Calculation problems - e.g. convergence failure. */
34  const int64_t Bug = 32; /* An inconsistent state has been encountered in the simulator - should probably exit. */
35  }
36 
38 
39  bool isPower2(int64_t x);
40  std::string fileMessage(const std::string& path, int line , const std::string& msg);
41  std::string fileMessage(int64_t messageType , const std::string& path, int line , const std::string& msg);
42  std::string prefixMessage(int64_t messageType , const std::string& msg);
43 
44 }
45 }
46 
47 #endif
const int64_t Info
Definition: LogUtil.hpp:30
const int64_t Bug
Definition: LogUtil.hpp:34
Definition: Deck.hpp:29
const int64_t Problem
Definition: LogUtil.hpp:33
const int64_t Error
Definition: LogUtil.hpp:32
std::string fileMessage(const std::string &path, int line, const std::string &msg)
const int64_t Warning
Definition: LogUtil.hpp:31
std::string prefixMessage(int64_t messageType, const std::string &msg)
bool isPower2(int64_t x)
const int64_t DefaultMessageTypes
Definition: LogUtil.hpp:37
const int64_t Debug
Definition: LogUtil.hpp:29