Implements a basic logger.
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
type(logger_t), | public | :: | logger |
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
character(len=:), | public, | allocatable | :: | fn | Name of the log file |
||
integer, | public | :: | fu | = | huge(0) | Unit number of the log file |
|
logical, | public | :: | is_open | = | .false. | Is the log file open for writing? {T/F} |
procedure, public :: init => logger_init | |
procedure, public :: finish => logger_finish | |
procedure, public :: log_msg => logger_log_msg |
Initializes a logger.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(logger_t), | intent(out) | :: | this | A |
||
character(len=*), | intent(in) | :: | fn | Name of the log file. If |
||
logical, | intent(in) | :: | use_stdout | Write all log messages to stdout rather than a file on disk? {T/F} |
Cleanup routine for a logger_t
instance.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(logger_t), | intent(inout) | :: | this | A |
Write a message to the log file.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(logger_t), | intent(in) | :: | this | A |
||
character(len=*), | intent(in) | :: | msg | Message to write to the log file |