mod_logging Module



Contents


Variables

TypeVisibilityAttributesNameInitial
character(len=8), public, parameter:: exp_fmt ="(e20.8)"

exponential format

character(len=8), public, parameter:: dp_fmt ="(f20.8)"

shorter float format

character(len=4), public, parameter:: int_fmt ="(i8)"

integer format

type(logger_t), public :: logger

Interfaces

public interface str

  • private pure function logical_tostring(boolean) result(string)

    Arguments

    TypeIntentOptionalAttributesName
    logical, intent(in) :: boolean

    Return Value character,allocatable

  • private pure function integer_tostring(int_value, fmt) result(string)

    Arguments

    TypeIntentOptionalAttributesName
    integer, intent(in) :: int_value
    character(len=*), intent(in), optional :: fmt

    Return Value character,allocatable

  • private pure function real_tostring(real_value, fmt) result(string)

    Arguments

    TypeIntentOptionalAttributesName
    real(kind=dp), intent(in) :: real_value
    character(len=*), intent(in), optional :: fmt

    Return Value character,allocatable

  • private pure function complex_tostring(complex_value, fmt) result(string)

    Arguments

    TypeIntentOptionalAttributesName
    complex(kind=dp), intent(in) :: complex_value
    character(len=*), intent(in), optional :: fmt

    Return Value character,allocatable

  • private pure function character_array_tostring(array) result(string)

    Arguments

    TypeIntentOptionalAttributesName
    character(len=*), intent(in) :: array(:)

    the array to convert

    Return Value character,allocatable

    returned result, trimmed


Derived Types

type, public :: logger_t

Components

TypeVisibilityAttributesNameInitial
integer, private :: logging_level
logical, private :: use_prefix

Type-Bound Procedures

procedure, public, nopass :: error
procedure, public :: warning
procedure, public :: info
procedure, public :: debug
procedure, public :: initialise
procedure, public :: set_logging_level
procedure, public :: get_logging_level
procedure, public :: enable_prefix
procedure, public :: disable_prefix

Functions

private pure function get_logging_level(this) result(logging_level)

Arguments

TypeIntentOptionalAttributesName
class(logger_t), intent(in) :: this

Return Value integer

private pure function logical_tostring(boolean) result(string)

Arguments

TypeIntentOptionalAttributesName
logical, intent(in) :: boolean

Return Value character,allocatable

private pure function integer_tostring(int_value, fmt) result(string)

Arguments

TypeIntentOptionalAttributesName
integer, intent(in) :: int_value
character(len=*), intent(in), optional :: fmt

Return Value character,allocatable

private pure function real_tostring(real_value, fmt) result(string)

Arguments

TypeIntentOptionalAttributesName
real(kind=dp), intent(in) :: real_value
character(len=*), intent(in), optional :: fmt

Return Value character,allocatable

private pure function complex_tostring(complex_value, fmt) result(string)

Arguments

TypeIntentOptionalAttributesName
complex(kind=dp), intent(in) :: complex_value
character(len=*), intent(in), optional :: fmt

Return Value character,allocatable

private pure function character_array_tostring(array) result(string)

Arguments

TypeIntentOptionalAttributesName
character(len=*), intent(in) :: array(:)

the array to convert

Return Value character,allocatable

returned result, trimmed


Subroutines

private pure subroutine initialise(this)

Arguments

TypeIntentOptionalAttributesName
class(logger_t), intent(inout) :: this

private pure subroutine set_logging_level(this, logging_level)

Arguments

TypeIntentOptionalAttributesName
class(logger_t), intent(inout) :: this
integer, intent(in) :: logging_level

private pure subroutine enable_prefix(this)

Arguments

TypeIntentOptionalAttributesName
class(logger_t), intent(inout) :: this

private pure subroutine disable_prefix(this)

Arguments

TypeIntentOptionalAttributesName
class(logger_t), intent(inout) :: this

private subroutine error(msg)

Arguments

TypeIntentOptionalAttributesName
character(len=*), intent(in) :: msg

private subroutine warning(this, msg)

Arguments

TypeIntentOptionalAttributesName
class(logger_t), intent(in) :: this
character(len=*), intent(in) :: msg

private subroutine info(this, msg)

Arguments

TypeIntentOptionalAttributesName
class(logger_t), intent(in) :: this
character(len=*), intent(in) :: msg

private subroutine debug(this, msg)

Arguments

TypeIntentOptionalAttributesName
class(logger_t), intent(in) :: this
character(len=*), intent(in) :: msg