3 use fruit
, only : assert_equals, assert_not_equals, assert_true
15 character(len=30) :: outpt
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")
31 call assert_not_equals(
str(j)//
" level", outpt, &
32 "Message ignored for specific logging_mod level")
40 character(len=7) :: preamble
56 character(len=15) function str(k)
57 integer,
intent(in) :: k
66 use fruit
, only : init_fruit, run_test_case, fruit_summary
70 logical :: error_fatal
character(len= *), parameter error_preamble
Error message preamble.
logical, parameter error_is_fatal
Whether an error log message is fatal and stops execution.
integer, parameter, public log_error
Only log ERROR messages.
program test_logging_mod_driver
character(len=15) function str(k)
integer, parameter, public log_debug
Log DEBUG, INFO, WARNING and ERROR messages.
character(len=7) function get_logging_preamble(level)
Returns the string preamble that applies to the specific logging level.
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...
subroutine, public log_set_logging_level(level)
Sets the logging level, messages with less priority will be ignored.
integer, parameter, public log_warn
Log WARNING and ERROR messages.
character(len= *), parameter warn_preamble
Warning message preable.
subroutine test_logging_level
subroutine test_logging_preamble()
integer, parameter, public log_info
Log INFO, WARNING and ERROR messages.
character(len= *), parameter info_preamble
Info message preamble.
integer function, public log_get_logging_level()
Retrieves the current logging level.
character(len= *), parameter debug_preamble
Debug message preamble.