OSFI-Fortran  3.10.0
OpenSF Integration Library
osfi_ehlog Module Reference

EHLog routines Procedures for presenting messages in the standard output in a format that can later be interpreted by openSF and others following the E2E-ICD. More...

Functions/Subroutines

subroutine, public osfi_error (message)
 Shows a formatted message of the desired type (error/warning/info/debug). More...
 
subroutine, public osfi_warning (message)
 Shows a formatted message of the desired type (error/warning/info/debug). More...
 
subroutine, public osfi_info (message)
 Shows a formatted message of the desired type (error/warning/info/debug). More...
 
subroutine, public osfi_debug (message)
 Shows a formatted message of the desired type (error/warning/info/debug). More...
 
subroutine, public osfi_progress (n, m)
 Shows a formatted progress message. More...
 
subroutine, public osfi_finishexecution (errorCode)
 Shows an information message and exits the program execution with an specific error code. More...
 
logical function, public osfi_logger_isdebugging ()
 Checks if the system is in debug mode.
 

Detailed Description

EHLog routines 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:

  • Information. This is a message raised by the model describing a harmless event, giving knowledge to the user. Model execution should continue with no interruptions.
  • Warning. The model 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 model execution and the model itself informs the user about it, so the model has time to “gracefully” close the execution.
  • Debug. Detailed information of the model execution given to the user. Information is intended to lead the user (or model developer) upon fixing a problem. This is a harmless event so model execution should continue with no interruptions.
  • Progress. Numerical information on the amount of model execution performed.

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.

Function/Subroutine Documentation

◆ osfi_debug()

subroutine, public osfi_ehlog::osfi_debug ( character(len=*), intent(in)  message)

Shows a formatted message of the desired type (error/warning/info/debug).

Parameters
message- text of the message
Note
The message is only shown if the environment variable "DEBUG_MODE" is equal to "On". The first time this procedure is called, it checks the declaration of that variable. If it is not declared, a warning message is shown and "Off" is assumed.

References osfi_logger_isdebugging().

◆ osfi_error()

subroutine, public osfi_ehlog::osfi_error ( character(len=*), intent(in)  message)

Shows a formatted message of the desired type (error/warning/info/debug).

Parameters
message- text of the message

◆ osfi_finishexecution()

subroutine, public osfi_ehlog::osfi_finishexecution ( integer, intent(in)  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 subroutine never returns and causes termination of the program.

◆ osfi_info()

subroutine, public osfi_ehlog::osfi_info ( character(len=*), intent(in)  message)

Shows a formatted message of the desired type (error/warning/info/debug).

Parameters
message- text of the message

◆ osfi_progress()

subroutine, public osfi_ehlog::osfi_progress ( integer, intent(in)  n,
integer, intent(in)  m 
)

Shows a formatted progress message.

Parameters
n- current step number
m- maximum number of steps.

◆ osfi_warning()

subroutine, public osfi_ehlog::osfi_warning ( character(len=*), intent(in)  message)

Shows a formatted message of the desired type (error/warning/info/debug).

Parameters
message- text of the message