Provides routines for printing different types of messages to standard out, standard error, and/or a log file.
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer, | public, | parameter | :: | debug | = | 10 | Priority level for output only useful for debugging |
| integer, | public, | parameter | :: | trivia | = | 20 | Priority level for output which may be useful but is very detailed or not especially important. |
| integer, | public, | parameter | :: | info | = | 30 | Priority level for output generated by the normal execution of the program. |
| integer, | public, | parameter | :: | warning | = | 40 | Priority level for output which indicates some part of the program is not behaving as it ideally should. |
| integer, | public, | parameter | :: | error | = | 50 | Priority level for output which indicates an error has occurred which will affect the continued execution of the program. |
| integer, | public, | parameter | :: | fatal | = | 60 | Priority level for output which notifies the user than a serious error has occured which will result in the immediate termination of the program. |
| type(logger), | public | :: | master_logger | The main logger object for a program to use. Must be initialised in the main program with a call to logger_init. |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | logfile | Name of the log-file to which output will be written |
||
| integer, | intent(in), | optional | :: | stderr_threshold | Threshold priority, at and above which messages will be
written to standard error. Defaults to |
|
| integer, | intent(in), | optional | :: | stdout_threshold | Threshold priority, at and above which messages will be
written to standard out. Defaults to |
|
| integer, | intent(in), | optional | :: | logfile_threshold | Threshold priority, at and above which messages will be
written to the log file. Defaults to |
An object to handle output of information about the executing program to the terminal and to a log-file.
| private function constructor(logfile, stderr_threshold, stdout_threshold, logfile_threshold) |
| final :: logger_finalize |
| procedure, public :: message => logger_message | Write a message of a given priority to the appropriate location(s) |
| procedure, public :: debug => logger_debug | Write debug information |
| procedure, public :: trivia => logger_trivia | Write trivial run-time information |
| procedure, public :: info => logger_info | Write run-time information |
| procedure, public :: warning => logger_warning | Write warning message |
| procedure, public :: error => logger_error | Write error message |
| procedure, public :: fatal => logger_fatal | Write notification of fatal error |
| procedure, public :: destroy => logger_destroy | Closes the log-file |
| procedure, public :: is_open => logger_is_open | Return |
Initalises the master logging object. This subroutine must be called before the master logger is used. It should only be called once.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | logfile | Name of the log-file to which output will be written |
||
| integer, | intent(in), | optional | :: | stderr_threshold | Threshold priority, at and above which messages will be
written to standard error. Defaults to |
|
| integer, | intent(in), | optional | :: | stdout_threshold | Threshold priority, at and above which messages will be
written to standard out. Defaults to |
|
| integer, | intent(in), | optional | :: | logfile_threshold | Threshold priority, at and above which messages will be
written to the log file. Defaults to |