Object Logger

  • All Implemented Interfaces:

    
    public class Logger
    
                        

    Static logger for issuing log entries.

    • Constructor Detail

    • Method Detail

      • tag

         final TaggedLogger tag(String tag)

        Gets a tagged logger instance. Tags are case-sensitive.

        Parameters:
        tag - Tag for logger or null for receiving an untagged logger
        Returns:

        Logger instance

      • tags

         final TaggedLogger tags(String tags)

        Gets a tagged logger instance that logs to multiple tags. Tags are case-sensitive.

        Parameters:
        tags - Tags for the logger or nothing for an untagged logger.
        Returns:

        Logger instance

      • isTraceEnabled

         final Boolean isTraceEnabled()

        Checks whether log entries at TRACE level will be output.

        Returns:

        true if TRACE level is enabled, false if disabled

      • trace

         final Unit trace(String message)

        Logs a message at TRACE level.

        Parameters:
        message - Text message to log
      • trace

         final Unit trace(Function0<String> message)

        Logs a lazy message at TRACE level. The message will be only evaluated if the log entry is really output.

        Parameters:
        message - Function that produces the message
      • trace

         final Unit trace(String message, Object arguments)

        Logs a formatted message at TRACE level. "{}" placeholders will be replaced by given arguments.

        Parameters:
        message - Formatted text message to log
        arguments - Arguments for formatted text message
      • trace

         final Unit trace(String message, Function0<Object> arguments)

        Logs a formatted message at TRACE level. "{}" placeholders will be replaced by given lazy arguments. The arguments will be only evaluated if the log entry is really output.

        Parameters:
        message - Formatted text message to log
        arguments - Functions that produce the arguments for formatted text message
      • trace

         final Unit trace(Throwable exception)

        Logs an exception at TRACE level.

        Parameters:
        exception - Caught exception or any other throwable to log
      • trace

         final Unit trace(Throwable exception, String message)

        Logs an exception with a custom message at TRACE level.

        Parameters:
        exception - Caught exception or any other throwable to log
        message - Text message to log
      • trace

         final Unit trace(Throwable exception, Function0<String> message)

        Logs an exception with a custom lazy message at TRACE level. The message will be only evaluated if the log entry is really output.

        Parameters:
        exception - Caught exception or any other throwable to log
        message - Function that produces the message
      • trace

         final Unit trace(Throwable exception, String message, Object arguments)

        Logs an exception with a formatted custom message at TRACE level. "{}" placeholders will be replaced by given arguments.

        Parameters:
        exception - Caught exception or any other throwable to log
        message - Formatted text message to log
        arguments - Arguments for formatted text message
      • trace

         final Unit trace(Throwable exception, String message, Function0<Object> arguments)

        Logs an exception with a formatted message at TRACE level. "{}" placeholders will be replaced by given lazy arguments. The arguments will be only evaluated if the log entry is really output.

        Parameters:
        exception - Caught exception or any other throwable to log
        message - Formatted text message to log
        arguments - Functions that produce the arguments for formatted text message
      • isDebugEnabled

         final Boolean isDebugEnabled()

        Checks whether log entries at DEBUG level will be output.

        Returns:

        true if DEBUG level is enabled, false if disabled

      • debug

         final Unit debug(String message)

        Logs a message at DEBUG level.

        Parameters:
        message - Text message to log
      • debug

         final Unit debug(Function0<String> message)

        Logs a lazy message at DEBUG level. The message will be only evaluated if the log entry is really output.

        Parameters:
        message - Function that produces the message
      • debug

         final Unit debug(String message, Object arguments)

        Logs a formatted message at DEBUG level. "{}" placeholders will be replaced by given arguments.

        Parameters:
        message - Formatted text message to log
        arguments - Arguments for formatted text message
      • debug

         final Unit debug(String message, Function0<Object> arguments)

        Logs a formatted message at DEBUG level. "{}" placeholders will be replaced by given lazy arguments. The arguments will be only evaluated if the log entry is really output.

        Parameters:
        message - Formatted text message to log
        arguments - Functions that produce the arguments for formatted text message
      • debug

         final Unit debug(Throwable exception)

        Logs an exception at DEBUG level.

        Parameters:
        exception - Caught exception or any other throwable to log
      • debug

         final Unit debug(Throwable exception, String message)

        Logs an exception with a custom message at DEBUG level.

        Parameters:
        exception - Caught exception or any other throwable to log
        message - Text message to log
      • debug

         final Unit debug(Throwable exception, Function0<String> message)

        Logs an exception with a custom lazy message at DEBUG level. The message will be only evaluated if the log entry is really output.

        Parameters:
        exception - Caught exception or any other throwable to log
        message - Function that produces the message
      • debug

         final Unit debug(Throwable exception, String message, Object arguments)

        Logs an exception with a formatted custom message at DEBUG level. "{}" placeholders will be replaced by given arguments.

        Parameters:
        exception - Caught exception or any other throwable to log
        message - Formatted text message to log
        arguments - Arguments for formatted text message
      • debug

         final Unit debug(Throwable exception, String message, Function0<Object> arguments)

        Logs an exception with a formatted message at DEBUG level. "{}" placeholders will be replaced by given lazy arguments. The arguments will be only evaluated if the log entry is really output.

        Parameters:
        exception - Caught exception or any other throwable to log
        message - Formatted text message to log
        arguments - Functions that produce the arguments for formatted text message
      • isInfoEnabled

         final Boolean isInfoEnabled()

        Checks whether log entries at INFO level will be output.

        Returns:

        true if INFO level is enabled, false if disabled

      • info

         final Unit info(String message)

        Logs a message at INFO level.

        Parameters:
        message - Text message to log
      • info

         final Unit info(Function0<String> message)

        Logs a lazy message at INFO level. The message will be only evaluated if the log entry is really output.

        Parameters:
        message - Function that produces the message
      • info

         final Unit info(String message, Object arguments)

        Logs a formatted message at INFO level. "{}" placeholders will be replaced by given arguments.

        Parameters:
        message - Formatted text message to log
        arguments - Arguments for formatted text message
      • info

         final Unit info(String message, Function0<Object> arguments)

        Logs a formatted message at INFO level. "{}" placeholders will be replaced by given lazy arguments. The arguments will be only evaluated if the log entry is really output.

        Parameters:
        message - Formatted text message to log
        arguments - Functions that produce the arguments for formatted text message
      • info

         final Unit info(Throwable exception)

        Logs an exception at INFO level.

        Parameters:
        exception - Caught exception or any other throwable to log
      • info

         final Unit info(Throwable exception, String message)

        Logs an exception with a custom message at INFO level.

        Parameters:
        exception - Caught exception or any other throwable to log
        message - Text message to log
      • info

         final Unit info(Throwable exception, Function0<String> message)

        Logs an exception with a custom lazy message at INFO level. The message will be only evaluated if the log entry is really output.

        Parameters:
        exception - Caught exception or any other throwable to log
        message - Function that produces the message
      • info

         final Unit info(Throwable exception, String message, Object arguments)

        Logs an exception with a formatted custom message at INFO level. "{}" placeholders will be replaced by given arguments.

        Parameters:
        exception - Caught exception or any other throwable to log
        message - Formatted text message to log
        arguments - Arguments for formatted text message
      • info

         final Unit info(Throwable exception, String message, Function0<Object> arguments)

        Logs an exception with a formatted message at INFO level. "{}" placeholders will be replaced by given lazy arguments. The arguments will be only evaluated if the log entry is really output.

        Parameters:
        exception - Caught exception or any other throwable to log
        message - Formatted text message to log
        arguments - Functions that produce the arguments for formatted text message
      • isWarnEnabled

         final Boolean isWarnEnabled()

        Checks whether log entries at WARN level will be output.

        Returns:

        true if WARN level is enabled, false if disabled

      • warn

         final Unit warn(String message)

        Logs a message at WARN level.

        Parameters:
        message - Text message to log
      • warn

         final Unit warn(Function0<String> message)

        Logs a lazy message at WARN level. The message will be only evaluated if the log entry is really output.

        Parameters:
        message - Function that produces the message
      • warn

         final Unit warn(String message, Object arguments)

        Logs a formatted message at WARN level. "{}" placeholders will be replaced by given arguments.

        Parameters:
        message - Formatted text message to log
        arguments - Arguments for formatted text message
      • warn

         final Unit warn(String message, Function0<Object> arguments)

        Logs a formatted message at WARN level. "{}" placeholders will be replaced by given lazy arguments. The arguments will be only evaluated if the log entry is really output.

        Parameters:
        message - Formatted text message to log
        arguments - Functions that produce the arguments for formatted text message
      • warn

         final Unit warn(Throwable exception)

        Logs an exception at WARN level.

        Parameters:
        exception - Caught exception or any other throwable to log
      • warn

         final Unit warn(Throwable exception, String message)

        Logs an exception with a custom message at WARN level.

        Parameters:
        exception - Caught exception or any other throwable to log
        message - Text message to log
      • warn

         final Unit warn(Throwable exception, Function0<String> message)

        Logs an exception with a custom lazy message at WARN level. The message will be only evaluated if the log entry is really output.

        Parameters:
        exception - Caught exception or any other throwable to log
        message - Function that produces the message
      • warn

         final Unit warn(Throwable exception, String message, Object arguments)

        Logs an exception with a formatted custom message at WARN level. "{}" placeholders will be replaced by given arguments.

        Parameters:
        exception - Caught exception or any other throwable to log
        message - Formatted text message to log
        arguments - Arguments for formatted text message
      • warn

         final Unit warn(Throwable exception, String message, Function0<Object> arguments)

        Logs an exception with a formatted message at WARN level. "{}" placeholders will be replaced by given lazy arguments. The arguments will be only evaluated if the log entry is really output.

        Parameters:
        exception - Caught exception or any other throwable to log
        message - Formatted text message to log
        arguments - Functions that produce the arguments for formatted text message
      • isErrorEnabled

         final Boolean isErrorEnabled()

        Checks whether log entries at ERROR level will be output.

        Returns:

        true if ERROR level is enabled, false if disabled

      • error

         final Unit error(String message)

        Logs a message at ERROR level.

        Parameters:
        message - Text message to log
      • error

         final Unit error(Function0<String> message)

        Logs a lazy message at ERROR level. The message will be only evaluated if the log entry is really output.

        Parameters:
        message - Function that produces the message
      • error

         final Unit error(String message, Object arguments)

        Logs a formatted message at ERROR level. "{}" placeholders will be replaced by given arguments.

        Parameters:
        message - Formatted text message to log
        arguments - Arguments for formatted text message
      • error

         final Unit error(String message, Function0<Object> arguments)

        Logs a formatted message at ERROR level. "{}" placeholders will be replaced by given lazy arguments. The arguments will be only evaluated if the log entry is really output.

        Parameters:
        message - Formatted text message to log
        arguments - Functions that produce the arguments for formatted text message
      • error

         final Unit error(Throwable exception)

        Logs an exception at ERROR level.

        Parameters:
        exception - Caught exception or any other throwable to log
      • error

         final Unit error(Throwable exception, String message)

        Logs an exception with a custom message at ERROR level.

        Parameters:
        exception - Caught exception or any other throwable to log
        message - Text message to log
      • error

         final Unit error(Throwable exception, Function0<String> message)

        Logs an exception with a custom lazy message at ERROR level. The message will be only evaluated if the log entry is really output.

        Parameters:
        exception - Caught exception or any other throwable to log
        message - Function that produces the message
      • error

         final Unit error(Throwable exception, String message, Object arguments)

        Logs an exception with a formatted custom message at ERROR level. "{}" placeholders will be replaced by given arguments.

        Parameters:
        exception - Caught exception or any other throwable to log
        message - Formatted text message to log
        arguments - Arguments for formatted text message
      • error

         final Unit error(Throwable exception, String message, Function0<Object> arguments)

        Logs an exception with a formatted message at ERROR level. "{}" placeholders will be replaced by given lazy arguments. The arguments will be only evaluated if the log entry is really output.

        Parameters:
        exception - Caught exception or any other throwable to log
        message - Formatted text message to log
        arguments - Functions that produce the arguments for formatted text message