Flush all buffered entries through the real logger, then clear the buffer. This is impure — call it once you are back outside the pure call chain.
Usage: call flush_log_buffer(global_logger, log_buf)
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(logger_type), | intent(in) | :: | logger | |||
| type(log_buffer_type), | intent(inout) | :: | buf |
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer(kind=default_int), | private | :: | i |
subroutine flush_log_buffer(logger, buf) !! Flush all buffered entries through the real logger, then clear the buffer. !! This is impure — call it once you are back outside the pure call chain. !! !! Usage: !! call flush_log_buffer(global_logger, log_buf) !! type(logger_type), intent(in) :: logger type(log_buffer_type), intent(inout) :: buf integer(default_int) :: i do i = 1, buf%count call dispatch(logger, buf%entries(i)) end do if (buf%truncated > 0) then call logger%warning("Pure log buffer: some messages were truncated due to length limits") end if if (buf%overflow > 0) then call logger%warning("Pure log buffer overflow: some messages were dropped") end if call clear_log_buffer(buf) end subroutine flush_log_buffer