Procedures for presenting messages in the standard output in E2E-ICD compliant format.
More...
Procedures for presenting messages in the standard output in E2E-ICD compliant format.
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:
- Information. This is a message raised by the module describing a harmless event, giving knowledge to the user. Module execution should continue with no interruptions.
- Warning. The module has detected a non-fatal error or situation that may cause a fatal error. This is a harmless event, thus, the execution should continue with no interruption.
- Error. A fatal error has happened in the module execution and the module itself informs the user about it, so the module has time to “gracefully” close the execution.
- Debug. Detailed information of the module execution given to the user. Information is intended to lead the user (or module developer) upon fixing a problem. This is a harmless event so module execution should continue with no interruptions.
- Progress. Numerical information on the amount of module execution performed.
Debug messages are only presented if an environment variable named DEBUG_MODE
is defined and set as On
in the module execution context.
A way to finish the module execution (after a fatal error or at the expected end of the execution) and return a success or failure code to the operating system is also provided.
Most functions in this module operate like the "printf" family: they take a format and variadic arguments. The main difference is that a line terminator is added automatically to each call.
◆ osfiLoggerDebug()
void osfiLoggerDebug |
( |
const char * |
format, |
|
|
|
... |
|
) |
| |
Shows a formatted debug message if the environment variable DEBUG_MODE
is set to On
. The environment is only guaranteed to be checked the first time this function is called. If DEBUG_MODE
is not declared, presents a warning message and assumes it as "Off".
- Parameters
-
format | - text of the message |
◆ osfiLoggerError()
void osfiLoggerError |
( |
const char * |
format, |
|
|
|
... |
|
) |
| |
Shows a formatted error message.
- Parameters
-
format | - text of the message |
- Examples
- CLP.c, and ConFM.c.
◆ osfiLoggerFinishExecution()
_Noreturn void osfiLoggerFinishExecution |
( |
int |
errorCode | ) |
|
Shows an information message and exits the program execution with an specific error code.
- Parameters
-
errorCode | - Code of error to exit with. |
- Warning
- This call never returns and causes termination of the program.
◆ osfiLoggerInfo()
void osfiLoggerInfo |
( |
const char * |
format, |
|
|
|
... |
|
) |
| |
Shows a formatted information message.
- Parameters
-
format | - text of the message |
- Examples
- CLP.c, and ConFM.c.
◆ osfiLoggerProgress()
void osfiLoggerProgress |
( |
int |
n, |
|
|
int |
m |
|
) |
| |
Shows a formatted progress message.
- Parameters
-
n | - current step number |
m | - maximum number of steps. |
◆ osfiLoggerQuality()
void osfiLoggerQuality |
( |
const char * |
name, |
|
|
const char * |
value |
|
) |
| |
Shows a formatted message reporting a quality indicator
- Parameters
-
name | - Name of the quality indicator |
value | - String associated to the quality indicator pointed by name |
◆ osfiLoggerQualityDouble()
void osfiLoggerQualityDouble |
( |
const char * |
name, |
|
|
double |
value |
|
) |
| |
Shows a formated message reporting a quality indicator
- Parameters
-
name | - Name of the quality indicator |
value | - Double associated to the quality indicator pointed by name |
◆ osfiLoggerWarning()
void osfiLoggerWarning |
( |
const char * |
format, |
|
|
|
... |
|
) |
| |
Shows a formatted warning message.
- Parameters
-
format | - text of the message |