Class DefaultLogger

java.lang.Object
com.aquima.interactions.foundation.logging.DefaultLogger
All Implemented Interfaces:
Logger

public class DefaultLogger extends Object implements Logger
Default logger that uses the standard output to print messages to.
Since:
5.0
Author:
O. Kerpershoek
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructs the logger with a class type.
    Constructs the logger with a name.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    debug(Object message)
    Allows an object to be logged in conjunction with a cause to the underlying logging system.
    void
    debug(Object message, Throwable cause)
    Allows an object to be logged in conjunction with a cause to the underlying logging system.
    void
    error(Object message)
    Allows an object to be logged in conjunction with a cause to the underlying logging system.
    void
    error(Object message, Throwable cause)
    Allows an object to be logged in conjunction with a cause to the underlying logging system.
    void
    info(Object message)
    Allows an object to be logged in conjunction with a cause to the underlying logging system.
    void
    info(Object message, Object[] args)
    Allows an object to be logged in conjunction with a cause to the underlying logging system.
    void
    info(Object message, Throwable cause)
    Allows an object to be logged in conjunction with a cause to the underlying logging system.
    boolean
    This function can be queried to choose whether to actually log certain debug statements.
    boolean
    This function can be queried to choose whether to actually log certain error statements.
    boolean
    This function can be queried to choose whether to actually log certain info statements.
    boolean
    This function can be queried to choose whether to actually log certain trace statements.
    boolean
    This function can be queried to choose whether to actually log certain warning statements.
    void
    trace(Object message)
    Allows an object to be logged in conjunction with a cause to the underlying logging system.
    void
    warning(Object message)
    Allows an object to be logged in conjunction with a cause to the underlying logging system.
    void
    warning(Object message, Throwable cause)
    Allows an object to be logged in conjunction with a cause to the underlying logging system.

    Methods inherited from class java.lang.Object

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

    • DefaultLogger

      public DefaultLogger(String name)
      Constructs the logger with a name.
      Parameters:
      name - The name of the logger.
    • DefaultLogger

      public DefaultLogger(Class<?> type)
      Constructs the logger with a class type.
      Parameters:
      type - The class type the logger is created for.
  • Method Details

    • trace

      public void trace(Object message)
      Description copied from interface: Logger
      Allows an object to be logged in conjunction with a cause to the underlying logging system. If the logging systems trace is enabled the log will be printed.
      Specified by:
      trace in interface Logger
      Parameters:
      message - The message to be logged.
    • debug

      public void debug(Object message, Throwable cause)
      Description copied from interface: Logger
      Allows an object to be logged in conjunction with a cause to the underlying logging system. If the logging systems debug is enable the log will be printed.
      Specified by:
      debug in interface Logger
      Parameters:
      message - The message to be logged.
      cause - The cause which should be printed alongside with the message.
    • debug

      public void debug(Object message)
      Description copied from interface: Logger
      Allows an object to be logged in conjunction with a cause to the underlying logging system. If the logging systems debug is enabled the log will be printed.
      Specified by:
      debug in interface Logger
      Parameters:
      message - The message to be logged.
    • error

      public void error(Object message, Throwable cause)
      Description copied from interface: Logger
      Allows an object to be logged in conjunction with a cause to the underlying logging system. If the logging systems error level is enabled the log will be printed. Errors are important in keeping the system running. In case of error the system is (or will be in danger of) crashing. The Error level should always be part of the output system and visible to system administrators.
      Specified by:
      error in interface Logger
      Parameters:
      message - The message to be logged.
      cause - The cause which should be printed alongside with the message.
    • error

      public void error(Object message)
      Description copied from interface: Logger
      Allows an object to be logged in conjunction with a cause to the underlying logging system. If the logging systems error level is enabled the log will be printed. Errors are important in keeping the system running. In case of error the system is (or will be in danger of) crashing. The Error level should always be part of the output system and visible to system administrators.
      Specified by:
      error in interface Logger
      Parameters:
      message - The message to be logged.
    • info

      public void info(Object message, Throwable cause)
      Description copied from interface: Logger
      Allows an object to be logged in conjunction with a cause to the underlying logging system. If the logging systems info level is enabled the log will be printed. Info is a 'higher level' message then debug. One can expect at least info will be printed as debug is quite superfluous. Info messages are purely environmental informational and should not be used as method of 'warning' the user.
      Specified by:
      info in interface Logger
      Parameters:
      message - The message to be logged.
      cause - The cause which should be printed alongside with the message.
    • info

      public void info(Object message, Object[] args)
      Description copied from interface: Logger
      Allows an object to be logged in conjunction with a cause to the underlying logging system. If the logging systems info level is enabled the log will be printed. Info is a 'higher level' message then debug. One can expect at least info will be printed as debug is quite superfluous. Info messages are purely environmental informational and should not be used as method of 'warning' the user.
      Specified by:
      info in interface Logger
      Parameters:
      message - The message to be logged.
      args - Arguments to format the message with.
    • info

      public void info(Object message)
      Description copied from interface: Logger
      Allows an object to be logged in conjunction with a cause to the underlying logging system. If the logging systems info level is enabled the log will be printed. Info is a 'higher level' message then debug. One can expect at least info will be printed as debug is quite superfluous. Info messages are purely environmental informational and should not be used as method of 'warning' the user.
      Specified by:
      info in interface Logger
      Parameters:
      message - The message to be logged.
    • warning

      public void warning(Object message, Throwable cause)
      Description copied from interface: Logger
      Allows an object to be logged in conjunction with a cause to the underlying logging system. If the logging systems warning level is enabled the log will be printed. Warnings are important in keeping the system in healthy operation mode. As a warning may cause problems in later stages. Facts learn us that given enough time they always do. The Warning level should always be part of the output system and visible to system administrators.
      Specified by:
      warning in interface Logger
      Parameters:
      message - The message to be logged.
      cause - The cause which should be printed alongside with the message.
    • warning

      public void warning(Object message)
      Description copied from interface: Logger
      Allows an object to be logged in conjunction with a cause to the underlying logging system. If the logging systems warning level is enabled the log will be printed. Warnings are important in keeping the system in healthy operation mode. As a warning may cause problems in later stages. Facts learn us that given enough time they always do. The Warning level should always be part of the output system and visible to system administrators.
      Specified by:
      warning in interface Logger
      Parameters:
      message - The message to be logged.
    • isTraceEnabled

      public boolean isTraceEnabled()
      Description copied from interface: Logger
      This function can be queried to choose whether to actually log certain trace statements. Trace message output should be low since string concatenations etc are expensive operations which should generally be avoided.
      Specified by:
      isTraceEnabled in interface Logger
      Returns:
      A boolean indicating that trace messaging is enabled.
    • isDebugEnabled

      public boolean isDebugEnabled()
      Description copied from interface: Logger
      This function can be queried to choose whether to actually log certain debug statements. Debugging message output should be low since string concatenations etc are expensive operations which should generally be avoided.
      Specified by:
      isDebugEnabled in interface Logger
      Returns:
      A boolean indicating that debug messaging is enabled.
    • isInfoEnabled

      public boolean isInfoEnabled()
      Description copied from interface: Logger
      This function can be queried to choose whether to actually log certain info statements.
      Specified by:
      isInfoEnabled in interface Logger
      Returns:
      A boolean indicating that info messaging is enabled.
    • isWarningEnabled

      public boolean isWarningEnabled()
      Description copied from interface: Logger
      This function can be queried to choose whether to actually log certain warning statements.
      Specified by:
      isWarningEnabled in interface Logger
      Returns:
      A boolean indicating that warning messaging is enabled.
    • isErrorEnabled

      public boolean isErrorEnabled()
      Description copied from interface: Logger
      This function can be queried to choose whether to actually log certain error statements.
      Specified by:
      isErrorEnabled in interface Logger
      Returns:
      A boolean indicating that error messaging is enabled.