A class for managing log messages. More...
#include <RMGLog.hh>
Public Types | |
| enum | LogLevel { debug_event = 0 , debug = 10 , detail = 20 , summary = 30 , warning = 40 , error = 50 , fatal = 60 , nothing = 70 } |
| enum | Ansi { black = 30 , red = 31 , green = 32 , yellow = 33 , blue = 34 , magenta = 35 , cyan = 36 , grey = 37 , unspecified } |
Public Member Functions | |
Constructor and destructor | |
| RMGLog () | |
Static Public Member Functions | |
Getters | |
| static RMGLog::LogLevel | GetLogLevel () |
| static bool | GetPrefix () |
Setters | |
| static void | SetLogLevel (RMGLog::LogLevel loglevel) |
| static void | SetPrefix (bool flag) |
| static void | SetProcNum (int proc_num) |
| static void | SetInihibitStartupInfo (bool flag) |
Miscellaneous | |
| template<typename T> | |
| static void | Out (RMGLog::LogLevel loglevel, const T &message) |
| template<typename T, typename... Args> | |
| static void | Out (RMGLog::LogLevel loglevel, const T &msg_first, const Args &... args) |
| template<typename... Args> | |
| static void | OutFormat (RMGLog::LogLevel loglevel, const std::string &fmt, const Args &... args) |
| template<typename T, typename... Args> | |
| static void | Out (RMGLog::LogLevel loglevel, T &msg_first, Args... msg_other) |
| static void | StartupInfo () |
| static const std::string & | GetVersion () |
| static bool | SupportsColors (const std::ostream &os) |
| template<RMGLog::Ansi color, typename T> | |
| static std::string | Colorize (const T &msg, std::ostream &os, bool bold=false) |
| static bool | HadWarning () |
| static bool | HadError () |
A class for managing log messages.
This class manages log messages for printing on the screen
| enum RMGLog::LogLevel |
Enumerator for the amount of details to put into the log
| RMGLog::RMGLog | ( | ) |
Constructor.
|
inlinestatic |
Returns the minimum log level for screen output.
|
inlinestatic |
Returns true if the loglevel is prefixed to every message. Default: true
|
inlinestatic |
|
static |
Writes string to the screen log if the log level is equal or greater than the minimum
| loglevel | loglevel for the current message |
| message | string to write to the screen log |
|
inlinestatic |
Toggle if a startup message is shown before the first log message.
|
inlinestatic |
Sets the minimum log level for screen output.
| loglevel | log level |
|
inlinestatic |
Toggle if the loglevel is prefixed to every message.
|
inlinestatic |
Set the process number.
|
static |
Writes startup information onto screen