OSFI-C++
3.10.0
OpenSF Integration Library
|
#include <Logger.h>
Static Public Member Functions | |
static void | error (const string &message) |
static void | warning (const string &message) |
static void | info (const string &message) |
static void | debug (const string &message) |
static ostream & | getErrorStream () |
static ostream & | getDebugStream () |
static ostream & | getInfoStream () |
static ostream & | getWarningStream () |
static void | progress (int step, int nSteps) |
static void | finishExecution (int errorCode) |
static void | qualityReport (const string &name, double value) |
static void | qualityReport (const string &name, const string &value) |
static ostream & | getQualityStream () |
static bool | isDebugging () |
static bool | isColored () |
Procedures for presenting messages in the standard output in a format that can later be interpreted by openSF and others following the E2E-ICD.
EHLog formats the logging messages as follows:
<message> ::= (<progress> | <log>) <EOL> <progress> ::= “Progress” <whitespaces> <delimiter> <whitespaces> <progress_body> <delimiter> ::= “|” <progress_body> ::= <integer> “ of ” <whitespace> <integer> <log> ::= <type> <whitespaces> <delimiter> <whitespaces> <text> <type> ::= “Error” | “Warning” | “Info” | “Debug” <white_spaces> ::= (“ “)+
This format defines five different types of messages:
Logger class presents debug messages only if an environment variables named “DEBUG_MODE” is defined and set as “On” in the model execution context. Logger also provides a way to finish the model execution (after a fatal error or at the expected end of the execution) and return a non-zero code to the operating system.
|
static |
Shows a formatted debug message, if the environment variable "DEBUG_MODE" is equal to "On". First time this function is called, checks the declaration of that variable. If it is not declared, presents a warning message and assumes it as "Off".
message | - text of the message |
|
static |
Shows a formatted error message.
message | - text of the message |
|
static |
Shows an information message and exits the program execution with an specific error code.
errorCode | - Code of error to exit with. |
|
static |
Returns the output stream used to show debugging messages. Developers can use this function as a convenient method for showing complex data types. Returns a "null stream" is not in debug mode, implying that nothing is written on output stream.
|
static |
Returns the output stream used to show error messages. Developers can use this function as a convenient method for showing complex data types.
|
static |
Returns the output stream used to show information messages. Developers can use this function as a convenient method for showing complex data types.
|
static |
Returns the output stream used to show quality messages. Developers can use this function as a convenient method for showing complex data types.
|
static |
Returns the output stream used to show warning messages. Developers can use this function as a convenient method for showing complex data types.
|
static |
Shows a formatted information message.
message | - text of the message |
|
static |
Checks if the system is in color mode. LOG_COLOR if ON the OSFI logs are colored.
|
static |
Checks if the system is in debug mode.
|
static |
Shows a formatted progress message.
step | - current step number |
nSteps | - maximum number of steps. |
|
static |
Shows a formatted message reporting a quality indicator
name | - Name of the quality indicator |
value | - String associated to the quality indicator pointed by name |
|
static |
Shows a formated message reporting a quality indicator
name | - Name of the quality indicator |
value | - Double associated to the quality indicator pointed by name |
|
static |
Shows a formatted warning message.
message | - text of the message |