Interface FixedLevelLogger


  • public interface FixedLevelLogger
    A logger that logs at a fixed LogLevel.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      boolean isEnabled()
      Determine if the level is enabled.
      void log​(java.lang.String msg)
      Log a String corresponding level.
      void log​(java.lang.String format, java.lang.Object arg)
      Log a message at the corresponding level according to the specified format and argument.
      void log​(java.lang.String format, java.lang.Object... args)
      Log a message at the corresponding level according to the specified format and arguments.
      void log​(java.lang.String format, java.lang.Object arg1, java.lang.Object arg2)
      Log a message at the corresponding level according to the specified format and arguments.
      void log​(java.lang.String msg, java.lang.Throwable cause)
      Log an Exception at the corresponding level with an accompanying message.
      java.lang.String loggerName()
      Get the logger name.
      LogLevel logLevel()
      Get the level of this logger.
    • Method Detail

      • loggerName

        java.lang.String loggerName()
        Get the logger name.
        Returns:
        the logger name.
      • logLevel

        LogLevel logLevel()
        Get the level of this logger.
        Returns:
        the level of this logger.
      • isEnabled

        boolean isEnabled()
        Determine if the level is enabled.
        Returns:
        true if the level is enabled.
      • log

        void log​(java.lang.String msg)
        Log a String corresponding level.
        Parameters:
        msg - the message to log.
      • log

        void log​(java.lang.String msg,
                 java.lang.Throwable cause)
        Log an Exception at the corresponding level with an accompanying message.
        Parameters:
        msg - the message accompanying the exception.
        cause - the exception (throwable) to log.
      • log

        void log​(java.lang.String format,
                 java.lang.Object arg)
        Log a message at the corresponding level according to the specified format and argument.

        This form avoids superfluous object creation when the logger is disabled for the corresponding level

        Parameters:
        format - the format string.
        arg - the argument.
      • log

        void log​(java.lang.String format,
                 java.lang.Object arg1,
                 java.lang.Object arg2)
        Log a message at the corresponding level according to the specified format and arguments.

        This form avoids superfluous object creation when the logger is disabled for the corresponding level.

        Parameters:
        format - the format string.
        arg1 - the first argument.
        arg2 - the second argument.
      • log

        void log​(java.lang.String format,
                 java.lang.Object... args)
        Log a message at the corresponding level according to the specified format and arguments.

        This form avoids superfluous string concatenation when the logger is disabled for the corresponding level. However, this variant incurs the hidden (and relatively small) cost of creating an Object[] before invoking the method, even if this logger is disabled for the corresponding level. The variants taking one and two arguments exist solely in order to avoid this hidden cost.

        Parameters:
        format - the format string.
        args - a list of 3 or more arguments.