Logger Derived Type

type, public :: Logger


Inherits

type~~logger~~InheritsGraph type~logger Logger type~format_file Format_file type~logger->type~format_file file_format

Components

Type Visibility Attributes Name Initial
integer, public :: verbosity_level = 1
logical, public :: to_terminal = .true.
logical, public :: to_file = .false.
integer, public :: frequency = 10
character(len=100), public :: filename = "Log"
type(Format_file), public :: file_format = FORMAT_FILE_LOG
integer, public :: file_unit = 99
character(len=100), public :: message = "Default log message"
logical, public :: show_Logger_initialization = .true.
logical, public :: show_matrix_test = .true.
logical, public :: show_info_solver = .true.
logical, public :: show_iteration = .true.
logical, public :: show_final = .true.

Type-Bound Procedures

procedure, public :: init => init_logger

  • private subroutine init_logger(this)

    Arguments

    Type IntentOptional Attributes Name
    class(Logger), intent(inout) :: this

procedure, public :: log_info

  • private subroutine log_info(this, msg)

    Arguments

    Type IntentOptional Attributes Name
    class(Logger), intent(inout) :: this
    character(kind=ucs4, len=*), intent(in) :: msg

procedure, public :: log_detail

  • private subroutine log_detail(this, msg)

    Arguments

    Type IntentOptional Attributes Name
    class(Logger), intent(inout) :: this
    character(kind=ucs4, len=*), intent(in) :: msg

procedure, public :: log_warning

  • private subroutine log_warning(this, msg)

    Arguments

    Type IntentOptional Attributes Name
    class(Logger), intent(inout) :: this
    character(kind=ucs4, len=*), intent(in) :: msg

procedure, public :: log_error

  • private subroutine log_error(this, msg)

    Arguments

    Type IntentOptional Attributes Name
    class(Logger), intent(inout) :: this
    character(kind=ucs4, len=*), intent(in) :: msg

procedure, public :: log_time

  • private subroutine log_time(this, msg)

    Arguments

    Type IntentOptional Attributes Name
    class(Logger), intent(inout) :: this
    character(kind=ucs4, len=*), intent(in) :: msg

procedure, public :: write => write_output

  • private subroutine write_output(this, msg, name_level, color_level, box_style)

    Arguments

    Type IntentOptional Attributes Name
    class(Logger), intent(in) :: this
    character(kind=ucs4, len=*), intent(in) :: msg
    character(kind=ucs4, len=*), intent(in), optional :: name_level
    character(kind=ucs4, len=*), intent(in), optional :: color_level
    character(len=*), intent(in), optional :: box_style

procedure, public :: close => close_logger

  • private subroutine close_logger(this)

    Arguments

    Type IntentOptional Attributes Name
    class(Logger), intent(inout) :: this

Source Code

    type :: Logger
        integer :: verbosity_level = 1
        logical :: to_terminal = .true.
        logical :: to_file = .false.
        integer :: frequency = 10
        character(LEN=100) :: filename = "Log"
        type(Format_file) :: file_format = FORMAT_FILE_LOG
        integer :: file_unit = 99
        character(LEN=100) :: message = "Default log message"

        logical :: show_Logger_initialization = .true.
        logical :: show_matrix_test = .true.
        logical :: show_info_solver = .true.
        logical :: show_iteration = .true.
        logical :: show_final = .true.

    contains

        procedure :: init => init_logger
        procedure :: log_info
        procedure :: log_detail
        procedure :: log_warning
        procedure :: log_error
        procedure :: log_time
        procedure :: write => write_output
        procedure :: close => close_logger
    end type Logger