OSFI-C  3.10.0
OpenSF Integration Library
Logging messages and progress

Procedures for presenting messages in the standard output in E2E-ICD compliant format. More...

Functions

void osfiLoggerError (const char *format,...)
 
void osfiLoggerWarning (const char *format,...)
 
void osfiLoggerInfo (const char *format,...)
 
void osfiLoggerDebug (const char *format,...)
 
void osfiLoggerProgress (int n, int m)
 
_Noreturn void osfiLoggerFinishExecution (int errorCode)
 
void osfiLoggerQuality (const char *name, const char *value)
 
void osfiLoggerQualityDouble (const char *name, double value)
 

Detailed Description

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:

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.

Function Documentation

◆ 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