Class LogsKt

  • All Implemented Interfaces:

    
    public final class LogsKt
    
                        
    • Constructor Detail

    • Method Detail

      • warnInterruptible

         final static Unit warnInterruptible(Object target, Throwable t)

        Log a warning message for an interruptible exception.

        This method logs the exception and manages InterruptedException.

        Parameters:
        target - the object that is being closed
        t - the exception thrown by the close method
      • warnInterruptible

         final static Unit warnInterruptible(Object target, Throwable t, String message, Object args)

        Log a warning message for an interruptible exception.

        This method logs the exception and manages InterruptedException.

        Parameters:
        target - the object that is being closed
        t - the exception thrown by the close method
        message - the message to log
      • warnUnexpected

         final static Unit warnUnexpected(Object target, Throwable t)

        Log a warning message for an unexpected exception.

        The exception is unexpected, it's best managed within custom code, such as event handlers. This method logs the exception, manages InterruptedException, and logs a message to emphasize that the exception is unexpected.

        Parameters:
        target - the object that is being closed
        t - the exception thrown by the close method
      • warnUnexpected

         final static Unit warnUnexpected(Object target, Throwable t, String message, Object args)

        Log a warning message for an unexpected exception.

        The exception is unexpected, it's best managed within custom code, such as event handlers. This method logs the exception, manages InterruptedException, and logs a message to emphasize that the exception is unexpected.

        Parameters:
        target - the object that is being closed
        t - the exception thrown by the close method
        message - the message to log
      • warnForClose

         final static Unit warnForClose(Object target, Throwable t)

        Log a warning message for a close method that throws an exception.

        It's very common for the close method to suppress exceptions and just log it, but some exceptions should be carefully handled, such as InterruptedException. It's strongly advised to not have the close method throw InterruptedException, but it's not guaranteed, so we suppress it and log a warning message if it happens.

        Parameters:
        target - the object that is being closed
        t - the exception thrown by the close method
      • warnForClose

         final static Unit warnForClose(Object target, Throwable t, String message, Object args)

        Log a warning message for a close method that throws an exception.

        It's very common for the close method to suppress exceptions and just log it, but some exceptions should be carefully handled, such as InterruptedException. It's strongly advised to not have the close method throw InterruptedException, but it's not guaranteed, so we suppress it and log a warning message if it happens.

        Parameters:
        target - the object that is being closed
        t - the exception thrown by the close method
        message - the message to log