MONC
|
Logging utility. More...
Functions/Subroutines | |
subroutine, public | initialise_logging (pid) |
Initialises the logging. This is done to make it easier for master logging only, so that we don't have to pass the process ID in each time. More... | |
subroutine, public | log_master_log (level, message) |
Will log just from the master process. More... | |
subroutine, public | log_master_newline () |
The master process will log a new line to stdio. More... | |
logical function, public | log_is_master () |
Determines whether the process is the master logging process. This might be preferable rather than calling masterLog due to having to construct the message for masterLog regardless. More... | |
subroutine, public | log_log (level, message, str) |
Logs a message at the specified level. If the level is above the current level then the message is ignored. If applicable then the message will be written to stdout or a provided string. More... | |
subroutine, public | log_newline () |
Will log a new line to the stdout. More... | |
character(len=7) function | get_logging_preamble (level) |
Returns the string preamble that applies to the specific logging level. More... | |
subroutine, public | log_set_logging_level (level) |
Sets the logging level, messages with less priority will be ignored. More... | |
integer function, public | log_get_logging_level () |
Retrieves the current logging level. More... | |
Variables | |
integer, parameter, private | master_process = 0 |
integer, parameter, public | log_error = 1 |
Only log ERROR messages. More... | |
integer, parameter, public | log_warn = 2 |
Log WARNING and ERROR messages. More... | |
integer, parameter, public | log_info = 3 |
Log INFO, WARNING and ERROR messages. More... | |
integer, parameter, public | log_debug = 4 |
Log DEBUG, INFO, WARNING and ERROR messages. More... | |
character(len= *), parameter | error_preamble = "[ERROR]" |
Error message preamble. More... | |
character(len= *), parameter | warn_preamble = "[WARN]" |
Warning message preable. More... | |
character(len= *), parameter | info_preamble = "[INFO]" |
Info message preamble. More... | |
character(len= *), parameter | debug_preamble = "[DEBUG]" |
Debug message preamble. More... | |
integer | current_log_level =LOG_INFO |
Private current logging state, the default is INFO level. More... | |
logical, parameter | error_is_fatal =.true. |
Whether an error log message is fatal and stops execution. More... | |
logical, save | i_am_master =.true. |
Whether or not I am the master process. More... | |
Logging utility.
|
private |
Returns the string preamble that applies to the specific logging level.
level | The logging level to translate into a string |
Definition at line 97 of file logging.F90.
subroutine, public logging_mod::initialise_logging | ( | integer, intent(in) | pid | ) |
Initialises the logging. This is done to make it easier for master logging only, so that we don't have to pass the process ID in each time.
pid | The process Id |
Definition at line 36 of file logging.F90.
integer function, public logging_mod::log_get_logging_level |
Retrieves the current logging level.
Definition at line 121 of file logging.F90.
logical function, public logging_mod::log_is_master |
Determines whether the process is the master logging process. This might be preferable rather than calling masterLog due to having to construct the message for masterLog regardless.
pid | The process id to test |
Definition at line 65 of file logging.F90.
subroutine, public logging_mod::log_log | ( | integer, intent(in) | level, |
character(len=*), intent(in) | message, | ||
character(len=*), intent(out), optional | str | ||
) |
Logs a message at the specified level. If the level is above the current level then the message is ignored. If applicable then the message will be written to stdout or a provided string.
level | The logging level |
message | The message to log |
str | Optional string to write the message into (rather than stdout) |
Definition at line 74 of file logging.F90.
subroutine, public logging_mod::log_master_log | ( | integer, intent(in) | level, |
character(len=*), intent(in) | message | ||
) |
Will log just from the master process.
level | The logging level |
message | The logging message |
myId | My process id |
Definition at line 46 of file logging.F90.
subroutine, public logging_mod::log_master_newline |
The master process will log a new line to stdio.
Definition at line 58 of file logging.F90.
subroutine, public logging_mod::log_newline |
subroutine, public logging_mod::log_set_logging_level | ( | integer, intent(in) | level | ) |
Sets the logging level, messages with less priority will be ignored.
level | The logging level to adopt |
Definition at line 113 of file logging.F90.
|
private |
Private current logging state, the default is INFO level.
Definition at line 22 of file logging.F90.
|
private |
Debug message preamble.
Definition at line 16 of file logging.F90.
|
private |
Whether an error log message is fatal and stops execution.
Definition at line 24 of file logging.F90.
|
private |
Error message preamble.
Definition at line 16 of file logging.F90.
|
private |
Whether or not I am the master process.
Definition at line 26 of file logging.F90.
|
private |
Info message preamble.
Definition at line 16 of file logging.F90.
integer, parameter, public logging_mod::log_debug = 4 |
Log DEBUG, INFO, WARNING and ERROR messages.
Definition at line 14 of file logging.F90.
integer, parameter, public logging_mod::log_error = 1 |
Only log ERROR messages.
Definition at line 11 of file logging.F90.
integer, parameter, public logging_mod::log_info = 3 |
Log INFO, WARNING and ERROR messages.
Definition at line 13 of file logging.F90.
integer, parameter, public logging_mod::log_warn = 2 |
Log WARNING and ERROR messages.
Definition at line 12 of file logging.F90.
|
private |
Definition at line 9 of file logging.F90.
|
private |
Warning message preable.
Definition at line 16 of file logging.F90.