23 #include <opm/common/OpmLog/Logger.hpp> 24 #include <opm/common/OpmLog/LogUtil.hpp> 32 #ifdef EMBEDDED_PYTHON 44 constexpr
static int defaultDebugVerbosityLevel = 1;
46 static void addMessage(std::int64_t messageFlag ,
const std::string& message);
47 static void addTaggedMessage(std::int64_t messageFlag,
const std::string& tag,
const std::string& message);
49 static void info(
const std::string& message);
50 static void warning(
const std::string& message);
51 static void error(
const std::string& message);
52 static void problem(
const std::string& message);
53 static void bug(
const std::string& message);
54 static void debug(
const std::string& message,
const int verbosity_level = defaultDebugVerbosityLevel);
55 static void note(
const std::string& message);
57 static void info(
const std::string& tag,
const std::string& message);
58 static void warning(
const std::string& tag,
const std::string& message);
59 static void error(
const std::string& tag,
const std::string& message);
60 static void problem(
const std::string& tag,
const std::string& message);
61 static void bug(
const std::string& tag,
const std::string& message);
62 static void debug(
const std::string& tag,
const std::string& message);
63 static void note(
const std::string& tag,
const std::string& message);
65 static bool hasBackend(
const std::string& backendName );
66 static void addBackend(
const std::string& name , std::shared_ptr<LogBackend> backend);
67 static bool removeBackend(
const std::string& name);
68 static void removeAllBackends();
69 static bool enabledMessageType( std::int64_t messageType );
70 static void addMessageType( std::int64_t messageType ,
const std::string& prefix);
72 static int getDebugVerbosityLevel() {
return debug_verbosity_level_; }
73 static void setDebugVerbosityLevel(
const int verbosity_level) { debug_verbosity_level_ = verbosity_level; }
82 const bool use_color_coding =
true,
83 const int message_limit = 10);
85 template <
class BackendType>
86 static std::shared_ptr<BackendType> getBackend(
const std::string& name) {
87 auto logger = getLogger();
88 return logger->getBackend<BackendType>(name);
91 template <
class BackendType>
92 static std::shared_ptr<BackendType> popBackend(
const std::string& name) {
93 auto logger = getLogger();
94 return logger->popBackend<BackendType>(name);
97 static bool stdoutIsTerminal();
113 static bool setLogger(std::shared_ptr<Logger> logger);
116 #ifdef EMBEDDED_PYTHON 117 friend class PyRunModule;
119 static int debug_verbosity_level_;
120 static std::shared_ptr<Logger> getLogger();
121 static std::shared_ptr<Logger> m_logger;
static bool setLogger(std::shared_ptr< Logger > logger)
Sets the global logger instance for the OpmLog class.
Definition: OpmLog.cpp:60
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition: Exceptions.hpp:30
Definition: OpmLog.hpp:41
static void setupSimpleDefaultLogging(const bool use_prefix=true, const bool use_color_coding=true, const int message_limit=10)
Create a basic logging setup that will send all log messages to standard output.
Definition: OpmLog.cpp:197