log_error Subroutine

public subroutine log_error(msg, module, procedure, stat, errmsg)

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: msg

Log message to print

character(len=*), intent(in), optional :: module

The name of the module in which the call happens

character(len=*), intent(in), optional :: procedure

The name of the procedure in which the call happens

integer, intent(in), optional :: stat

status message

character(len=*), intent(in), optional :: errmsg

error message


Source Code

   subroutine log_error(msg, module, procedure, stat, errmsg)
      character(len=*), intent(in)  :: msg
      !! Log message to print
      character(len=*), optional, intent(in)  :: module
      !! The name of the module in which the call happens
      character(len=*), optional, intent(in)  :: procedure
      !! The name of the procedure in which the call happens
      integer, optional, intent(in)  :: stat
      !! status message
      character(len=*), optional, intent(in)  :: errmsg
      !! error message
      if (logger_is_active) then
         call logger%log_error(msg, module=module, procedure=procedure, stat=stat, errmsg=errmsg)
         call flush_log_units()
      else
         print '(A,": ",A)', msg, errmsg
      end if
   end subroutine log_error