OpmLog.hpp
Go to the documentation of this file.
1/*
2 Copyright 2026 Equinor 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#ifndef OPM_GRID_LOG_HPP
20#define OPM_GRID_LOG_HPP
21
22#if HAVE_OPM_COMMON
23#include <opm/common/OpmLog/OpmLog.hpp>
24#else
25
26#include <iostream>
27#include <string_view>
28
29namespace Opm::OpmLog {
30 static inline void error(std::string_view msg)
31 {
32 std::cerr << msg << std::endl;
33 }
34
35 static inline void info(std::string_view msg)
36 {
37 std::cout << msg << std::endl;
38 }
39
40 static inline void warning(std::string_view msg)
41 {
42 std::cout << msg << std::endl;
43 }
44
45 static inline void warning(std::string_view tag, std::string_view msg)
46 {
47 std::cout << '[' << tag << "]: " << msg << std::endl;
48 }
49
50 static inline void setupSimpleDefaultLogging() {}
51}
52#endif
53
54#endif // OPM_GRID_LOG_HPP
Definition: OpmLog.hpp:29
static void warning(std::string_view msg)
Definition: OpmLog.hpp:40
static void setupSimpleDefaultLogging()
Definition: OpmLog.hpp:50
static void error(std::string_view msg)
Definition: OpmLog.hpp:30
static void info(std::string_view msg)
Definition: OpmLog.hpp:35