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} |
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 |
type logger_t
character(len=:), allocatable :: fn
!! Name of the log file
integer :: fu = huge(0)
!! Unit number of the log file
logical :: is_open = .false.
!! Is the log file open for writing? {T/F}
contains
procedure :: init => logger_init
procedure :: finish => logger_finish
procedure :: log_msg => logger_log_msg
end type logger_t