Package com.acumenvelocity.ath.common
Class Log
- java.lang.Object
-
- com.acumenvelocity.ath.common.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 voiddebug(Class<?> loggingClass, String format, Object... arguments)Logs a debug level message with parameterized formatting.static voiderror(Class<?> loggingClass, boolean printStackTrace, String format, Object... arguments)Logs an error level message with parameterized formatting.static voiderror(Class<?> loggingClass, String format, Object... arguments)Logs an error level message with parameterized formatting.static voiderror(Class<?> loggingClass, Throwable cause, boolean printStackTrace, String format, Object... arguments)static voiderror(Class<?> loggingClass, Throwable cause, String format, Object... arguments)Logs an error level message with exception details and parameterized formatting.static Stringformat(String format, Object... arguments)Formats a message string with parameters using SLF4J-style parameter substitution.static voidinfo(Class<?> loggingClass, String format, Object... arguments)Logs an info level message with parameterized formatting.static booleanisDebugEnabled(Class<?> loggingClass)Checks if debug level logging is enabled for the specified class.static booleanisTraceEnabled(Class<?> loggingClass)Checks if trace level logging is enabled for the specified class.static voidtrace(Class<?> loggingClass, String format, Object... arguments)Logs a trace level message with parameterized formatting.static voidwarn(Class<?> loggingClass, String format, Object... arguments)Logs a warn level message with parameterized formatting.
-
-
-
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 originatesformat- the message format stringarguments- 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 originatesformat- the message format stringarguments- 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 originatesformat- the message format stringarguments- 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 originatescause- the Throwable that caused the errorformat- the message format stringarguments- 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 originatesformat- the message format stringarguments- 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 originatesformat- the message format stringarguments- 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 originatesformat- the message format stringarguments- 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 {} placeholdersarguments- 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
-
-