The Logger class is used to store all the variables related to the units of files used to store or print messages during the development (debugging ) or running
logger constructor
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(logger) | :: | current_log |
a logger object |
Logger destructor
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(logger) | :: | current_log |
A logger object |
Subroutine to initialize a logger object
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(logger) | :: | current_log |
A logger object |
|||
character(len=*) | :: | log_file |
A character variable with the name of the file associated to the logger |
|||
logical, | intent(in), | optional | :: | append_ |
A logical (optional) variable to indicate if appending to an existing file is desired |
Subroutine to turn-off the logger
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(logger) | :: | current_log |
A logger object |
Function to check if a logger is initialized
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(logger) | :: | current_log |
A logger object |
A logical variable
Subroutine to send a message to the logger
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(logger) | :: | current_log |
A logger object |
|||
character(len=*) | :: | msg |
A character variable with the message to send to the logger |
Subroutine to write a message in a file associated with the logger
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(logger) | :: | current_log |
A logger object |
|||
integer, | intent(in) | :: | unit_ |
An integer variable with the value of the output unit |
||
character(len=*) | :: | msg |
A character variable with the message to be written in the output unit |
Subroutine to define the logger state
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(logger) | :: | current_log |
A logger object |
|||
character(len=*), | intent(in) | :: | option |
A character variable with the name of the state to be defined |
||
logical, | intent(in) | :: | value |
A logical variable |
Subroutine to define a logger integer state
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(logger) | :: | current_log |
A logger object |
|||
character(len=*), | intent(in) | :: | option |
A character variable with the name of the state to be defined |
||
integer, | intent(in) | :: | value |
An integer variable |
Subroutine to define a logger character state
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(logger) | :: | current_log |
A logger object |
|||
character(len=*), | intent(in) | :: | option |
A character variable with the name of the state to be defined |
||
character(len=*), | intent(in) | :: | value |
A character variable |
Function to get the logger unit
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(logger) | :: | current_log |
A logger object |
An integer variable with the logger unit
Subroutine that defines the delimiter in a logger repport
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(logger) | :: | current_log |
A logger object |
|||
character(len=*), | optional | :: | level |
A character variable with the definition of the delimiter |
Subroutine to get the delimiter text
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(logger) | :: | current_log |
A logger object |
|||
character(len=*) | :: | level |
A character variable |
|||
character(len=100) | :: | msg |
A character variable |
Subroutine to reset the logger
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(logger) | :: | current_log |
A logger object |
Subroutine to print an error message
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(logger) | :: | current_log |
A logger object |
|||
character(len=*), | intent(in) | :: | message |
A character varaible with the error message |
type logger private !! The Logger class is used to store all the variables related to the units of !! files used to store or print messages during the development (debugging ) or !! running integer :: fileunit,stdout logical :: activate_screen,activate_file,timestamp logical :: initialized,stoponerror character(len=NUMCHAR) :: level_string_volume,level_string_chapter,level_string_section character(len=NUMCHAR) :: level_string_subsection contains procedure,public :: create => create_logger procedure,public :: destroy => destroy_logger procedure,public :: startup procedure,public :: shutdown procedure,public :: is_initialized procedure,public :: message procedure,public :: write procedure,private :: get_available_unit procedure,private :: configure_logical procedure,private :: configure_integer procedure,private :: configure_character generic,public :: configure => configure_logical,configure_integer,configure_character ! generic,public :: get procedure,public :: get_unit procedure,public :: delimiter procedure,public :: get_delimiter procedure,public :: reset procedure,public :: error end type logger