MONC
Functions/Subroutines
test_logging_mod Module Reference

Functions/Subroutines

subroutine test_logging_level
 
subroutine test_logging_preamble ()
 
character(len=15) function str (k)
 

Function/Subroutine Documentation

◆ str()

character(len=15) function test_logging_mod::str ( integer, intent(in)  k)

Definition at line 56 of file test_logging.F90.

57  integer, intent(in) :: k
58  write (str, *) k
59  str = adjustl(str)
Here is the caller graph for this function:

◆ test_logging_level()

subroutine test_logging_mod::test_logging_level

Definition at line 14 of file test_logging.F90.

15  character(len=30) :: outpt
16 
17  integer i, j, space
18 
19  do i=1,4
20  call log_set_logging_level(i)
21  call assert_equals(i, log_get_logging_level(), "Logging level has been set correctly")
22  do j=1,4
23  call log_log(j, str(j)//" level", outpt)
24  if (j .le. i) then
25  space = index(outpt, "] ")
26  call assert_true(space .gt. 0, "The logging_mod message terminates")
27  outpt = outpt(space+2 : len(outpt))
28  call assert_equals(str(j)//" level", outpt, &
29  "Message included for specific logging_mod level")
30  else
31  call assert_not_equals(str(j)//" level", outpt, &
32  "Message ignored for specific logging_mod level")
33  end if
34  end do
35  end do
Here is the call graph for this function:
Here is the caller graph for this function:

◆ test_logging_preamble()

subroutine test_logging_mod::test_logging_preamble

Definition at line 39 of file test_logging.F90.

40  character(len=7) :: preamble
41 
42  preamble = get_logging_preamble(log_error)
43  call assert_equals(error_preamble, preamble)
44 
45  preamble = get_logging_preamble(log_warn)
46  call assert_equals(warn_preamble, preamble)
47 
48  preamble = get_logging_preamble(log_info)
49  call assert_equals(info_preamble, preamble)
50 
51  preamble = get_logging_preamble(log_debug)
52  call assert_equals(debug_preamble, preamble)
Here is the call graph for this function:
Here is the caller graph for this function:
logging_mod::log_error
integer, parameter, public log_error
Only log ERROR messages.
Definition: logging.F90:11
logging_mod::log_warn
integer, parameter, public log_warn
Log WARNING and ERROR messages.
Definition: logging.F90:12
logging_mod::log_info
integer, parameter, public log_info
Log INFO, WARNING and ERROR messages.
Definition: logging.F90:13
logging_mod::log_log
subroutine, public log_log(level, message, str)
Logs a message at the specified level. If the level is above the current level then the message is ig...
Definition: logging.F90:75
logging_mod::log_get_logging_level
integer function, public log_get_logging_level()
Retrieves the current logging level.
Definition: logging.F90:122
logging_mod::log_debug
integer, parameter, public log_debug
Log DEBUG, INFO, WARNING and ERROR messages.
Definition: logging.F90:14