public class LogAccessor
extends java.lang.Object
CharSequence
based log methods but also Supplier
based variants for use with Java 8 lambda expressions.Constructor and Description |
---|
LogAccessor(java.lang.Class<?> logCategory)
Create a new accessor for the specified Commons Log category.
|
LogAccessor(Log log)
Create a new accessor for the given Commons Log.
|
LogAccessor(java.lang.String logCategory)
Create a new accessor for the specified Commons Log category.
|
Modifier and Type | Method and Description |
---|---|
void |
debug(java.lang.CharSequence message)
Log a message with debug log level.
|
void |
debug(java.util.function.Supplier<? extends java.lang.CharSequence> messageSupplier)
Log a message with debug log level.
|
void |
debug(java.lang.Throwable cause,
java.lang.CharSequence message)
Log an error with debug log level.
|
void |
debug(java.lang.Throwable cause,
java.util.function.Supplier<? extends java.lang.CharSequence> messageSupplier)
Log an error with debug log level.
|
void |
error(java.lang.CharSequence message)
Log a message with error log level.
|
void |
error(java.util.function.Supplier<? extends java.lang.CharSequence> messageSupplier)
Log a message with error log level.
|
void |
error(java.lang.Throwable cause,
java.lang.CharSequence message)
Log an error with error log level.
|
void |
error(java.lang.Throwable cause,
java.util.function.Supplier<? extends java.lang.CharSequence> messageSupplier)
Log an error with error log level.
|
void |
fatal(java.lang.CharSequence message)
Log a message with fatal log level.
|
void |
fatal(java.util.function.Supplier<? extends java.lang.CharSequence> messageSupplier)
Log a message with fatal log level.
|
void |
fatal(java.lang.Throwable cause,
java.lang.CharSequence message)
Log an error with fatal log level.
|
void |
fatal(java.lang.Throwable cause,
java.util.function.Supplier<? extends java.lang.CharSequence> messageSupplier)
Log an error with fatal log level.
|
Log |
getLog()
Return the target Commons Log.
|
void |
info(java.lang.CharSequence message)
Log a message with info log level.
|
void |
info(java.util.function.Supplier<? extends java.lang.CharSequence> messageSupplier)
Log a message with info log level.
|
void |
info(java.lang.Throwable cause,
java.lang.CharSequence message)
Log an error with info log level.
|
void |
info(java.lang.Throwable cause,
java.util.function.Supplier<? extends java.lang.CharSequence> messageSupplier)
Log an error with info log level.
|
void |
trace(java.lang.CharSequence message)
Log a message with trace log level.
|
void |
trace(java.util.function.Supplier<? extends java.lang.CharSequence> messageSupplier)
Log a message with trace log level.
|
void |
trace(java.lang.Throwable cause,
java.lang.CharSequence message)
Log an error with trace log level.
|
void |
trace(java.lang.Throwable cause,
java.util.function.Supplier<? extends java.lang.CharSequence> messageSupplier)
Log an error with trace log level.
|
void |
warn(java.lang.CharSequence message)
Log a message with warn log level.
|
void |
warn(java.util.function.Supplier<? extends java.lang.CharSequence> messageSupplier)
Log a message with warn log level.
|
void |
warn(java.lang.Throwable cause,
java.lang.CharSequence message)
Log an error with warn log level.
|
void |
warn(java.lang.Throwable cause,
java.util.function.Supplier<? extends java.lang.CharSequence> messageSupplier)
Log an error with warn log level.
|
private final Log log
public LogAccessor(Log log)
public LogAccessor(java.lang.Class<?> logCategory)
LogFactory.getLog(Class)
public LogAccessor(java.lang.String logCategory)
LogFactory.getLog(String)
public final Log getLog()
public void fatal(java.lang.CharSequence message)
message
- the message to logpublic void fatal(java.lang.Throwable cause, java.lang.CharSequence message)
cause
- the exception to logmessage
- the message to logpublic void error(java.lang.CharSequence message)
message
- the message to logpublic void error(java.lang.Throwable cause, java.lang.CharSequence message)
cause
- the exception to logmessage
- the message to logpublic void warn(java.lang.CharSequence message)
message
- the message to logpublic void warn(java.lang.Throwable cause, java.lang.CharSequence message)
cause
- the exception to logmessage
- the message to logpublic void info(java.lang.CharSequence message)
message
- the message to logpublic void info(java.lang.Throwable cause, java.lang.CharSequence message)
cause
- the exception to logmessage
- the message to logpublic void debug(java.lang.CharSequence message)
message
- the message to logpublic void debug(java.lang.Throwable cause, java.lang.CharSequence message)
cause
- the exception to logmessage
- the message to logpublic void trace(java.lang.CharSequence message)
message
- the message to logpublic void trace(java.lang.Throwable cause, java.lang.CharSequence message)
cause
- the exception to logmessage
- the message to logpublic void fatal(java.util.function.Supplier<? extends java.lang.CharSequence> messageSupplier)
messageSupplier
- a lazy supplier for the message to logpublic void fatal(java.lang.Throwable cause, java.util.function.Supplier<? extends java.lang.CharSequence> messageSupplier)
cause
- the exception to logmessageSupplier
- a lazy supplier for the message to logpublic void error(java.util.function.Supplier<? extends java.lang.CharSequence> messageSupplier)
messageSupplier
- a lazy supplier for the message to logpublic void error(java.lang.Throwable cause, java.util.function.Supplier<? extends java.lang.CharSequence> messageSupplier)
cause
- the exception to logmessageSupplier
- a lazy supplier for the message to logpublic void warn(java.util.function.Supplier<? extends java.lang.CharSequence> messageSupplier)
messageSupplier
- a lazy supplier for the message to logpublic void warn(java.lang.Throwable cause, java.util.function.Supplier<? extends java.lang.CharSequence> messageSupplier)
cause
- the exception to logmessageSupplier
- a lazy supplier for the message to logpublic void info(java.util.function.Supplier<? extends java.lang.CharSequence> messageSupplier)
messageSupplier
- a lazy supplier for the message to logpublic void info(java.lang.Throwable cause, java.util.function.Supplier<? extends java.lang.CharSequence> messageSupplier)
cause
- the exception to logmessageSupplier
- a lazy supplier for the message to logpublic void debug(java.util.function.Supplier<? extends java.lang.CharSequence> messageSupplier)
messageSupplier
- a lazy supplier for the message to logpublic void debug(java.lang.Throwable cause, java.util.function.Supplier<? extends java.lang.CharSequence> messageSupplier)
cause
- the exception to logmessageSupplier
- a lazy supplier for the message to logpublic void trace(java.util.function.Supplier<? extends java.lang.CharSequence> messageSupplier)
messageSupplier
- a lazy supplier for the message to logpublic void trace(java.lang.Throwable cause, java.util.function.Supplier<? extends java.lang.CharSequence> messageSupplier)
cause
- the exception to logmessageSupplier
- a lazy supplier for the message to log