Manticore
Version 1.5.3
Physics of Molecular Clouds
|
Logging facility. More...
#include <mutils/Log.h>
Static Public Member Functions | |
template<typename... Args> | |
static int | debug (Args &&... args) |
Logs a message at level DEBUG. More... | |
template<typename... Args> | |
static int | error (Args &&... args) |
Logs a message at level ERROR. More... | |
template<typename... Args> | |
static int | info (Args &&... args) |
Logs a message at level INFO. More... | |
template<typename... Args> | |
static int | message (int lev, Args &&... args) |
Logs a message. More... | |
static const char * | name (int lev=mutils::Log::level) |
Standard logging level name string. More... | |
static void | setLevel (const std::string &str) |
Sets logging level from name string. More... | |
static int | setStream (const std::string &fname, bool append=true) |
Sets the logging stream. More... | |
template<typename... Args> | |
static int | warn (Args &&... args) |
Logs a message at level WARN. More... | |
Static Public Attributes | |
static constexpr int | DEBUG = 3 |
Verbose information. More... | |
static constexpr int | ERROR = 0 |
Error condition. More... | |
static std::string | file = "!" |
Message log file name. More... | |
static constexpr int | INFO = 2 |
Informational message. More... | |
static int | level = Log::WARN |
Message logging level for output to stream. More... | |
static FILE * | stream = stderr |
Message log file stream. More... | |
static constexpr int | WARN = 1 |
Warning condition. More... | |
Logging facility.
Supports the generation and use of log messages. Defined messaging levels:
Level | Name | Indication | Expectation |
---|---|---|---|
0 | ERROR | error condition | fatal, execution terminates |
1 | WARN | warning condition | recoverable, execution at risk |
2 | INFO | informational | execution not at risk |
3 | DEBUG | verbose information | normal execution |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
Logs a message.
Logs a message to stream if lev is less than or equal to level. The args are passed verbatim to cxxfprintf().
[in] | lev | Minimum log level required to print message. |
[in] | args | Arguments for cxxfprintf() (not including the stream). |
Definition at line 402 of file Log.h.
References mutils::cxxfprintf(), level, and stream.
|
inlinestatic |
Standard logging level name string.
[in] | lev | Message level (default: current logging level). |
Definition at line 355 of file Log.h.
References ERROR, INFO, and WARN.
Referenced by mutils::Exception::message(), and setLevel().
|
inlinestatic |
|
inlinestatic |
Sets the logging stream.
[in] | fname | Log file name ("-" is stdout, "!" is stderr). |
[in] | append | Whether to append to existing files (else overwrite). |
Definition at line 380 of file Log.h.
References mutils::cxxfclose(), mutils::cxxfopen(), file, and stream.
Referenced by main().
|
inlinestatic |
|
static |
Verbose information.
Definition at line 350 of file Log.h.
Referenced by debug(), manticore::findParameters(), setLevel(), and mutils::CommandLine::usage().
|
static |
Error condition.
Definition at line 347 of file Log.h.
Referenced by error(), name(), and setLevel().
|
static |
Message log file name.
Definition at line 436 of file Log.h.
Referenced by mutils::exitException(), and setStream().
|
static |
|
static |
Message logging level for output to stream.
Definition at line 430 of file Log.h.
Referenced by manticore::findParameters(), main(), message(), mutils::Exception::print(), setLevel(), and mutils::CommandLine::usage().
|
static |
Message log file stream.
Definition at line 433 of file Log.h.
Referenced by manticore::ccfCheck(), manticore::findParameters(), main(), message(), mutils::Exception::print(), manticore::printVersion(), and setStream().
|
static |