Interface Logger

  • All Known Subinterfaces:
    JobLogger, com.redwood.scheduler.infrastructure.logging.LoggerSetLevel, TriggerLogger

    public interface Logger
    Redwood logging.
    • Method Detail

      • debug

        void debug​(String message)
        Log a message object with the DEBUG level to the server logs. This method first checks if this Logger is DEBUG enabled by comparing the level of this Logger with the DEBUG level. If this Logger is DEBUG enabled, then it logs the message.
        Parameters:
        message - the message to log.
      • debug

        void debug​(String message,
                   Throwable t)
        Log a message object, along with the associated exception, with the DEBUG level to the server logs.
        Parameters:
        message - the message to log.
        t - an optional exception to log with the message.
        See Also:
        debug(String)
      • info

        void info​(String message)
        Log a message object with the INFO level to the server logs. This method first checks if this Logger is INFO enabled by comparing the level of this Logger with the INFO level. If this Logger is INFO enabled, then it logs the message.
        Parameters:
        message - the message to log.
      • info

        void info​(String message,
                  Throwable t)
        Log a message object, along with the associated exception, with the INFO level to the server logs.
        Parameters:
        message - the message to log.
        t - an optional exception to log with the message.
        See Also:
        info(String)
      • warn

        void warn​(String message)
        Log a message object with the WARN level to the server logs. This method first checks if this Logger is WARN enabled by comparing the level of this Logger with the WARN level. If this Logger is WARN enabled, then it logs the message.
        Parameters:
        message - the message to log.
      • warn

        void warn​(String message,
                  Throwable t)
        Log a message object, along with the associated exception, with the WARN level to the server logs.
        Parameters:
        message - the message to log.
        t - an optional exception to log with the message.
        See Also:
        warn(String)
      • error

        void error​(String message)
        Log a message object with the ERROR level to the server logs. This method first checks if this Logger is ERROR enabled by comparing the level of this Logger with the ERROR level. If this Logger is ERROR enabled, then it logs the message.
        Parameters:
        message - the message to log.
      • error

        void error​(String message,
                   Throwable t)
        Log a message object, along with the associated exception, with the ERROR level to the server logs.
        Parameters:
        message - the message to log.
        t - an optional exception to log with the message.
        See Also:
        error(String)
      • fatal

        void fatal​(String message)
        Log a message object with the FATAL level to the server logs. This method first checks if this Logger is FATAL enabled by comparing the level of this Logger with the FATAL level. If this Logger is FATAL enabled, then it logs the message.
        Parameters:
        message - the message to log.
      • fatal

        void fatal​(String message,
                   Throwable t)
        Log a message object, along with the associated exception, with the FATAL level to the server logs.
        Parameters:
        message - the message to log.
        t - an optional exception to log with the message.
        See Also:
        fatal(String)
      • isDebugEnabled

        boolean isDebugEnabled()
        Check whether this logger is enabled for the DEBUG Level.

        This function is intended to lessen the computational cost of disabled log debug statements.

        For some log Logger object, when you write,

         log.debug("This is entry number: " + i);
         

        You incur the cost constructing the message, concatenation in this case, regardless of whether the message is logged or not.

        If you are worried about speed, then you should use debug(Supplier)

        This way you will not incur the cost of parameter construction if debugging is disabled for log.

        Returns:
        boolean - true if this Logger is debug enabled, false otherwise.
      • isInfoEnabled

        boolean isInfoEnabled()
        Check whether this logger is enabled for the INFO Level.

        This function is intended to lessen the computational cost of disabled log debug statements.

        For some log LoggeLogger object, when you write,

         log.debug("This is entry number: " + i);
         

        You incur the cost constructing the message, concatenation in this case, regardless of whether the message is logged or not.

        If you are worried about speed, then you should use info(Supplier)

        This way you will not incur the cost of parameter construction if debugging is disabled for log.

        Returns:
        boolean - true if this Logger is info enabled, false otherwise.
      • isEnabledFor

        boolean isEnabledFor​(Level level)
        Check whether this logger is enabled for a given Level passed as parameter. See also isDebugEnabled().
        Parameters:
        level - the log level to check for.
        Returns:
        boolean True if this category is enabled for level.
      • log

        void log​(Level level,
                 String message)
        Log a message at a particular level. This generic form is intended to be used by wrappers.
        Parameters:
        level - the level to log at.
        message - the message to log.
      • log

        void log​(Level level,
                 String message,
                 Throwable t)
        Log a message at a particular level. This generic form is intended to be used by wrappers.
        Parameters:
        level - the level to log at.
        message - the message to log.
        t - an optional exception to log with the message.
      • info

        default void info​(Supplier<String> logMessage)
        Log a message object with the INFO level. This method first checks if this Logger is INFO enabled by comparing the level of this Logger with the INFO level. If this Logger is INFO enabled, then it evaluates the message offer and logs the message.
        Parameters:
        logMessage - Supplier that will provide the logMessage. The offer will only be evaluated if INFO is enabled.
      • info

        default void info​(Supplier<String> logMessage,
                          Throwable t)
        Similar to info(Supplier) but with an optional exception that should be logged
        Parameters:
        logMessage - Supplier that will provide the logMessage. The offer will only be evaluated if INFO is enabled.
        t - an exception to log with the message.
      • debug

        default void debug​(Supplier<String> logMessage)
        Log a message object with the DEBUG level to the server logs. This method first checks if this Logger is DEBUG enabled by comparing the level of this Logger with the DEBUG level. If this Logger is DEBUG enabled, then it evaluates the message offer and logs the message.
        Parameters:
        logMessage - Supplier that will provide the logMessage. The offer will only be evaluated if DEBUG is enabled.
      • debug

        default void debug​(Supplier<String> logMessage,
                           Throwable t)
        Similar to debug(Supplier) but with an optional exception that should be logged
        Parameters:
        logMessage - Supplier that will provide the logMessage. The offer will only be evaluated if DEBUG is enabled.
        t - an exception to log with the message.