Class Log


  • public class Log
    extends Object
    Utility class for application logging using SLF4J framework. Provides a simplified interface for logging with automatic logger management and message formatting capabilities.

    This class maintains a cache of Logger instances per class to avoid repeated logger lookups and improve performance.

    Since:
    1.0
    Version:
    1.0
    Author:
    Acumen Velocity
    See Also:
    Logger, LoggerFactory
    • Constructor Summary

      Constructors 
      Constructor Description
      Log()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void debug​(Class<?> loggingClass, String format, Object... arguments)
      Logs a debug level message with parameterized formatting.
      static void error​(Class<?> loggingClass, boolean printStackTrace, String format, Object... arguments)
      Logs an error level message with parameterized formatting.
      static void error​(Class<?> loggingClass, String format, Object... arguments)
      Logs an error level message with parameterized formatting.
      static void error​(Class<?> loggingClass, Throwable cause, boolean printStackTrace, String format, Object... arguments)  
      static void error​(Class<?> loggingClass, Throwable cause, String format, Object... arguments)
      Logs an error level message with exception details and parameterized formatting.
      static String format​(String format, Object... arguments)
      Formats a message string with parameters using SLF4J-style parameter substitution.
      static void info​(Class<?> loggingClass, String format, Object... arguments)
      Logs an info level message with parameterized formatting.
      static boolean isDebugEnabled​(Class<?> loggingClass)
      Checks if debug level logging is enabled for the specified class.
      static boolean isTraceEnabled​(Class<?> loggingClass)
      Checks if trace level logging is enabled for the specified class.
      static void trace​(Class<?> loggingClass, String format, Object... arguments)
      Logs a trace level message with parameterized formatting.
      static void warn​(Class<?> loggingClass, String format, Object... arguments)
      Logs a warn level message with parameterized formatting.
    • Constructor Detail

      • Log

        public Log()
    • Method Detail

      • debug

        public static void debug​(Class<?> loggingClass,
                                 String format,
                                 Object... arguments)
        Logs a debug level message with parameterized formatting.
        Parameters:
        loggingClass - the class from which the log originates
        format - the message format string
        arguments - the arguments for the format string
      • error

        public static void error​(Class<?> loggingClass,
                                 boolean printStackTrace,
                                 String format,
                                 Object... arguments)
        Logs an error level message with parameterized formatting.
        Parameters:
        loggingClass - the class from which the log originates
        format - the message format string
        arguments - the arguments for the format string
      • error

        public static void error​(Class<?> loggingClass,
                                 String format,
                                 Object... arguments)
        Logs an error level message with parameterized formatting.
        Parameters:
        loggingClass - the class from which the log originates
        format - the message format string
        arguments - the arguments for the format string
      • error

        public static void error​(Class<?> loggingClass,
                                 Throwable cause,
                                 String format,
                                 Object... arguments)
        Logs an error level message with exception details and parameterized formatting. Includes both the formatted message and exception information, plus stack trace.
        Parameters:
        loggingClass - the class from which the log originates
        cause - the Throwable that caused the error
        format - the message format string
        arguments - the arguments for the format string
      • error

        public static void error​(Class<?> loggingClass,
                                 Throwable cause,
                                 boolean printStackTrace,
                                 String format,
                                 Object... arguments)
      • info

        public static void info​(Class<?> loggingClass,
                                String format,
                                Object... arguments)
        Logs an info level message with parameterized formatting.
        Parameters:
        loggingClass - the class from which the log originates
        format - the message format string
        arguments - the arguments for the format string
      • trace

        public static void trace​(Class<?> loggingClass,
                                 String format,
                                 Object... arguments)
        Logs a trace level message with parameterized formatting.
        Parameters:
        loggingClass - the class from which the log originates
        format - the message format string
        arguments - the arguments for the format string
      • warn

        public static void warn​(Class<?> loggingClass,
                                String format,
                                Object... arguments)
        Logs a warn level message with parameterized formatting.
        Parameters:
        loggingClass - the class from which the log originates
        format - the message format string
        arguments - the arguments for the format string
      • format

        public static String format​(String format,
                                    Object... arguments)
        Formats a message string with parameters using SLF4J-style parameter substitution.
        Parameters:
        format - the message format string with {} placeholders
        arguments - the values to substitute into the placeholders
        Returns:
        formatted message string
      • isTraceEnabled

        public static boolean isTraceEnabled​(Class<?> loggingClass)
        Checks if trace level logging is enabled for the specified class.
        Parameters:
        loggingClass - the class to check
        Returns:
        true if trace level is enabled, false otherwise
      • isDebugEnabled

        public static boolean isDebugEnabled​(Class<?> loggingClass)
        Checks if debug level logging is enabled for the specified class.
        Parameters:
        loggingClass - the class to check
        Returns:
        true if debug level is enabled, false otherwise