Interface Logger

  • All Known Implementing Classes:
    ConsoleLogger, Slf4jLogger

    public interface Logger
    Simple logger interface.

    This is a private interface and should not be used outside this project.

    Since:
    4.0.0
    Author:
    Dmytro Nosan
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static String ROOT
      The root logger name.
    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void debug​(String message)
      Log the message from the provided message at debug level.
      void debug​(String message, Object... args)
      Log the message from the provided message at debug level.
      void debug​(Throwable throwable, String message)
      Log the provided Throwable and message at debug level.
      void debug​(Throwable throwable, String message, Object... args)
      Log the provided Throwable and message at debug level.
      void error​(String message)
      Log the message from the provided message at error level.
      void error​(String message, Object... args)
      Log the message from the provided message at error level.
      void error​(Throwable throwable, String message)
      Log the provided Throwable and message at error level.
      void error​(Throwable throwable, String message, Object... args)
      Log the provided Throwable and message at error level.
      static Logger get​(Class<?> clazz)
      Gets a Logger for the specified class.
      static Logger get​(String name)
      Gets a Logger for the specified name.
      String getName()
      Gets the name of this Logger instance.
      void info​(String message)
      Log the message from the provided at info level.
      void info​(String message, Object... args)
      Log the message from the provided at info level.
      void info​(Throwable throwable, String message)
      Log the provided Throwable and message at info level.
      void info​(Throwable throwable, String message, Object... args)
      Log the provided Throwable and message at info level.
      boolean isDebugEnabled()
      Is the logger instance enabled for the DEBUG level.
      boolean isErrorEnabled()
      Is the logger instance enabled for the ERROR level.
      boolean isInfoEnabled()
      Is the logger instance enabled for the INFO level.
      boolean isTraceEnabled()
      Is the logger instance enabled for the TRACE level.
      boolean isWarnEnabled()
      Is the logger instance enabled for the WARN level.
      void trace​(String message)
      Log the message from the provided message at trace level.
      void trace​(String message, Object... args)
      Log the message from the provided message at trace level.
      void trace​(Throwable throwable, String message)
      Log the provided Throwable and message at trace level.
      void trace​(Throwable throwable, String message, Object... args)
      Log the provided Throwable and message at trace level.
      void warn​(String message)
      Log the message from the provided message at warn level.
      void warn​(String message, Object... args)
      Log the message from the provided message at warn level.
      void warn​(Throwable throwable, String message)
      Log the provided Throwable and message at warn level.
      void warn​(Throwable throwable, String message, Object... args)
      Log the provided Throwable and message at warn level.
    • Method Detail

      • get

        static Logger get​(Class<?> clazz)
        Gets a Logger for the specified class.
        Parameters:
        clazz - the class for which to get the logger
        Returns:
        the logger
      • get

        static Logger get​(String name)
        Gets a Logger for the specified name.
        Parameters:
        name - the name for which to get the logger
        Returns:
        the logger
      • getName

        String getName()
        Gets the name of this Logger instance.
        Returns:
        name of this logger instance
      • isErrorEnabled

        boolean isErrorEnabled()
        Is the logger instance enabled for the ERROR level.
        Returns:
        true if this Logger is enabled for the ERROR level
      • error

        void error​(String message)
        Log the message from the provided message at error level.
        Parameters:
        message - the message string to be logged
      • error

        void error​(Throwable throwable,
                   String message)
        Log the provided Throwable and message at error level.
        Parameters:
        message - the message string to be logged
        throwable - the exception (throwable) to be logged
      • error

        void error​(Throwable throwable,
                   String message,
                   Object... args)
        Log the provided Throwable and message at error level.
        Parameters:
        throwable - the exception (throwable) to be logged
        message - the pattern string
        args - object(s) to format
        See Also:
        MessageFormat.format(String, Object...)
      • isWarnEnabled

        boolean isWarnEnabled()
        Is the logger instance enabled for the WARN level.
        Returns:
        true if this Logger is enabled for the WARN level
      • warn

        void warn​(String message)
        Log the message from the provided message at warn level.
        Parameters:
        message - the message string to be logged
      • warn

        void warn​(Throwable throwable,
                  String message)
        Log the provided Throwable and message at warn level.
        Parameters:
        throwable - the exception (throwable) to be logged
        message - the message string to be logged
      • isInfoEnabled

        boolean isInfoEnabled()
        Is the logger instance enabled for the INFO level.
        Returns:
        true if this Logger is enabled for the INFO level
      • info

        void info​(String message)
        Log the message from the provided at info level.
        Parameters:
        message - the message string to be logged
      • info

        void info​(Throwable throwable,
                  String message)
        Log the provided Throwable and message at info level.
        Parameters:
        throwable - the exception (throwable) to be logged
        message - the message string to be logged
      • isDebugEnabled

        boolean isDebugEnabled()
        Is the logger instance enabled for the DEBUG level.
        Returns:
        true if this Logger is enabled for the DEBUG level
      • debug

        void debug​(String message)
        Log the message from the provided message at debug level.
        Parameters:
        message - the message string to be logged
      • debug

        void debug​(Throwable throwable,
                   String message)
        Log the provided Throwable and message at debug level.
        Parameters:
        throwable - the exception (throwable) to be logged
        message - the message string to be logged
      • debug

        void debug​(Throwable throwable,
                   String message,
                   Object... args)
        Log the provided Throwable and message at debug level.
        Parameters:
        throwable - the exception (throwable) to be logged
        message - the pattern string
        args - object(s) to format
        See Also:
        MessageFormat.format(String, Object...)
      • isTraceEnabled

        boolean isTraceEnabled()
        Is the logger instance enabled for the TRACE level.
        Returns:
        true if this Logger is enabled for the TRACE level
      • trace

        void trace​(String message)
        Log the message from the provided message at trace level.
        Parameters:
        message - the message string to be logged
      • trace

        void trace​(Throwable throwable,
                   String message)
        Log the provided Throwable and message at trace level.
        Parameters:
        throwable - the exception (throwable) to be logged
        message - the message string to be logged
      • trace

        void trace​(Throwable throwable,
                   String message,
                   Object... args)
        Log the provided Throwable and message at trace level.
        Parameters:
        throwable - the exception (throwable) to be logged
        message - the pattern string
        args - object(s) to format
        See Also:
        MessageFormat.format(String, Object...)