Class DefaultLogger

  • All Implemented Interfaces:
    Logger

    public class DefaultLogger
    extends java.lang.Object
    implements Logger
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void debug​(java.lang.String message)
      Log with level 'debug'.
      This is a convenience method for Logger.log(LogLevel, String)
      void error​(java.lang.String message)
      Log with level 'error'.
      This is a convenience method for Logger.log(LogLevel, String)
      void error​(java.lang.String message, java.lang.Throwable t)
      Log with level 'error'.
      This is a convenience method for Logger.log(LogLevel, String, Throwable)
      void info​(java.lang.String message)
      Log with level 'info'.
      This is a convenience method for Logger.log(LogLevel, String)
      boolean isDebugEnabled()
      Return a flag if 'debug' level messages are currently printed
      boolean isErrorEnabled()
      Return a flag if 'error' level messages are currently printed
      boolean isInfoEnabled()
      Return a flag if 'info' level messages are currently printed
      boolean isWarnEnabled()
      Return a flag if 'warn' level messages are currently printed
      void log​(LogLevel level, java.lang.String message)
      Log with a given level and message
      void log​(LogLevel level, java.lang.String message, java.lang.Throwable throwable)
      Log with a given level, message and throwable
      void warning​(java.lang.String message)
      Log with level 'warning'.
      This is a convenience method for Logger.log(LogLevel, String)
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DefaultLogger

        public DefaultLogger​(LogLevel logLevel)
    • Method Detail

      • log

        public void log​(LogLevel level,
                        java.lang.String message)
        Description copied from interface: Logger
        Log with a given level and message
        Specified by:
        log in interface Logger
        Parameters:
        level - the level of the log entry
        message - the message to write to the log
      • log

        public void log​(LogLevel level,
                        java.lang.String message,
                        java.lang.Throwable throwable)
        Description copied from interface: Logger
        Log with a given level, message and throwable
        Specified by:
        log in interface Logger
        Parameters:
        level - the level of the log entry
        message - the message to write to the log
        throwable - an instance of a throwable to be attached to the output.
      • error

        public void error​(java.lang.String message)
        Description copied from interface: Logger
        Log with level 'error'.
        This is a convenience method for Logger.log(LogLevel, String)
        Specified by:
        error in interface Logger
        Parameters:
        message - the message to write to the log
      • error

        public void error​(java.lang.String message,
                          java.lang.Throwable t)
        Description copied from interface: Logger
        Log with level 'error'.
        This is a convenience method for Logger.log(LogLevel, String, Throwable)
        Specified by:
        error in interface Logger
        Parameters:
        message - the message to write to the log
        t - an instance of a throwable to be attached to the output
      • warning

        public void warning​(java.lang.String message)
        Description copied from interface: Logger
        Log with level 'warning'.
        This is a convenience method for Logger.log(LogLevel, String)
        Specified by:
        warning in interface Logger
        Parameters:
        message - the message to write to the log
      • info

        public void info​(java.lang.String message)
        Description copied from interface: Logger
        Log with level 'info'.
        This is a convenience method for Logger.log(LogLevel, String)
        Specified by:
        info in interface Logger
        Parameters:
        message - the message to write to the log
      • debug

        public void debug​(java.lang.String message)
        Description copied from interface: Logger
        Log with level 'debug'.
        This is a convenience method for Logger.log(LogLevel, String)
        Specified by:
        debug in interface Logger
        Parameters:
        message - the message to write to the log
      • isErrorEnabled

        public boolean isErrorEnabled()
        Description copied from interface: Logger
        Return a flag if 'error' level messages are currently printed
        Specified by:
        isErrorEnabled in interface Logger
        Returns:
        true if 'error' level messages are printed, false if not
      • isWarnEnabled

        public boolean isWarnEnabled()
        Description copied from interface: Logger
        Return a flag if 'warn' level messages are currently printed
        Specified by:
        isWarnEnabled in interface Logger
        Returns:
        true if 'warn' level messages are printed, false if not
      • isInfoEnabled

        public boolean isInfoEnabled()
        Description copied from interface: Logger
        Return a flag if 'info' level messages are currently printed
        Specified by:
        isInfoEnabled in interface Logger
        Returns:
        true if 'info' level messages are printed, false if not
      • isDebugEnabled

        public boolean isDebugEnabled()
        Description copied from interface: Logger
        Return a flag if 'debug' level messages are currently printed
        Specified by:
        isDebugEnabled in interface Logger
        Returns:
        true if 'debug' level messages are printed, false if not