Module de.carne

Class Log


  • public final class Log
    extends java.lang.Object
    Wrapper class for the JDK's Logger class to make logging easy and more efficient.
    • Constructor Summary

      Constructors 
      Constructor Description
      Log()
      Constructs a new Log instance.
      Log​(java.lang.Class<?> clazz)
      Constructs a new Log instance.
      Log​(java.lang.Class<?> clazz, java.lang.String resourceBundleName)
      Constructs a new Log isntance.
      Log​(java.lang.String resourceBundleName)
      Constructs a new Log instance.
    • Constructor Detail

      • Log

        public Log()
        Constructs a new Log instance.

        The created Logger is named after the calling class' name.

      • Log

        public Log​(java.lang.String resourceBundleName)
        Constructs a new Log instance.

        The created Logger is named after the calling class' name.

        Parameters:
        resourceBundleName - the name of the ResourceBundle to use for log message localization.
      • Log

        public Log​(java.lang.Class<?> clazz)
        Constructs a new Log instance.
        Parameters:
        clazz - the Class to use for the Logger name.
      • Log

        public Log​(java.lang.Class<?> clazz,
                   java.lang.String resourceBundleName)
        Constructs a new Log isntance.
        Parameters:
        clazz - the Class to use for the Logger name.
        resourceBundleName - the name of the ResourceBundle to use for log message localization.
    • Method Detail

      • root

        public static Log root()
        Gets the Log instance that represents the root Logger.
        Returns:
        the Log instance that represents the root Logger.
      • logger

        public java.util.logging.Logger logger()
        Gets the Logger represented by this instance.
        Returns:
        the Logger represented by this instance.
      • level

        public java.util.logging.Level level()
        Gets the log level configured for this instance.
        Returns:
        the log level configured for this instance.
      • isLoggable

        public boolean isLoggable​(java.util.logging.Level level)
        Checks whether a message of the submitted Level would be logged by this Log instance.
        Parameters:
        level - the Level to check.
        Returns:
        true if the submitted Level is enabled.
      • log

        public void log​(java.util.logging.Level level,
                        @Nullable java.lang.Throwable thrown,
                        java.lang.String msg,
                        java.lang.Object... parameters)
        Logs a message with the given severity.
        Parameters:
        level - the Level of the message.
        thrown - the Throwable related to the message (may be null).
        msg - the message to log.
        parameters - the message parameters to log.
      • notice

        public void notice​(java.lang.String msg,
                           java.lang.Object... parameters)
        Logs a LogLevel.LEVEL_NOTICE message.
        Parameters:
        msg - the message to log.
        parameters - the message parameters to log.
      • notice

        public void notice​(java.lang.Throwable thrown,
                           java.lang.String msg,
                           java.lang.Object... parameters)
        Logs a LogLevel.LEVEL_NOTICE message.
        Parameters:
        thrown - the Throwable related to the message (may be null).
        msg - the message to log.
        parameters - the message parameters to log.
      • error

        public void error​(java.lang.String msg,
                          java.lang.Object... parameters)
        Logs a LogLevel.LEVEL_ERROR message.
        Parameters:
        msg - the message to log.
        parameters - the message parameters to log.
      • error

        public void error​(java.lang.Throwable thrown,
                          java.lang.String msg,
                          java.lang.Object... parameters)
        Logs a LogLevel.LEVEL_ERROR message.
        Parameters:
        thrown - the Throwable related to the message (may be null).
        msg - the message to log.
        parameters - the message parameters to log.
      • warning

        public void warning​(java.lang.String msg,
                            java.lang.Object... parameters)
        Logs a LogLevel.LEVEL_WARNING message.
        Parameters:
        msg - the message to log.
        parameters - the message parameters to log.
      • warning

        public void warning​(java.lang.Throwable thrown,
                            java.lang.String msg,
                            java.lang.Object... parameters)
        Logs a LogLevel.LEVEL_WARNING message.
        Parameters:
        thrown - the Throwable related to the message (may be null).
        msg - the message to log.
        parameters - the message parameters to log.
      • info

        public void info​(java.lang.String msg,
                         java.lang.Object... parameters)
        Logs a LogLevel.LEVEL_INFO message.
        Parameters:
        msg - the message to log.
        parameters - the message parameters to log.
      • info

        public void info​(java.lang.Throwable thrown,
                         java.lang.String msg,
                         java.lang.Object... parameters)
        Logs a LogLevel.LEVEL_INFO message.
        Parameters:
        thrown - the Throwable related to the message (may be null).
        msg - the message to log.
        parameters - the message parameters to log.
      • debug

        public void debug​(java.lang.String msg,
                          java.lang.Object... parameters)
        Logs a LogLevel.LEVEL_DEBUG message.
        Parameters:
        msg - the message to log.
        parameters - the message parameters to log.
      • debug

        public void debug​(java.lang.Throwable thrown,
                          java.lang.String msg,
                          java.lang.Object... parameters)
        Logs a LogLevel.LEVEL_DEBUG message.
        Parameters:
        thrown - the Throwable related to the message (may be null).
        msg - the message to log.
        parameters - the message parameters to log.
      • trace

        public void trace​(java.lang.String msg,
                          java.lang.Object... parameters)
        Logs a LogLevel.LEVEL_TRACE message.
        Parameters:
        msg - the message to log.
        parameters - the message parameters to log.
      • trace

        public void trace​(java.lang.Throwable thrown,
                          java.lang.String msg,
                          java.lang.Object... parameters)
        Logs a LogLevel.LEVEL_TRACE message.
        Parameters:
        thrown - the Throwable related to the message (may be null).
        msg - the message to log.
        parameters - the message parameters to log.
      • callee

        public void callee​(java.util.logging.Level level)
        Logs the calling functions signature with the given severity.
        Parameters:
        level - the Level to lag at.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object