public class LogAccessor extends Object
CharSequence
based log methods but also Supplier
based variants for use with Java 8 lambda expressions.Constructor and Description |
---|
LogAccessor(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(String logCategory)
Create a new accessor for the specified Commons Log category.
|
Modifier and Type | Method and Description |
---|---|
void |
debug(CharSequence message)
Log a message with debug log level.
|
void |
debug(Supplier<? extends CharSequence> messageSupplier)
Log a message with debug log level.
|
void |
debug(Throwable cause,
CharSequence message)
Log an error with debug log level.
|
void |
debug(Throwable cause,
Supplier<? extends CharSequence> messageSupplier)
Log an error with debug log level.
|
void |
error(CharSequence message)
Log a message with error log level.
|
void |
error(Supplier<? extends CharSequence> messageSupplier)
Log a message with error log level.
|
void |
error(Throwable cause,
CharSequence message)
Log an error with error log level.
|
void |
error(Throwable cause,
Supplier<? extends CharSequence> messageSupplier)
Log an error with error log level.
|
void |
fatal(CharSequence message)
Log a message with fatal log level.
|
void |
fatal(Supplier<? extends CharSequence> messageSupplier)
Log a message with fatal log level.
|
void |
fatal(Throwable cause,
CharSequence message)
Log an error with fatal log level.
|
void |
fatal(Throwable cause,
Supplier<? extends CharSequence> messageSupplier)
Log an error with fatal log level.
|
Log |
getLog()
Return the target Commons Log.
|
void |
info(CharSequence message)
Log a message with info log level.
|
void |
info(Supplier<? extends CharSequence> messageSupplier)
Log a message with info log level.
|
void |
info(Throwable cause,
CharSequence message)
Log an error with info log level.
|
void |
info(Throwable cause,
Supplier<? extends CharSequence> messageSupplier)
Log an error with info log level.
|
boolean |
isDebugEnabled()
Is debug logging currently enabled?
|
boolean |
isErrorEnabled()
Is error logging currently enabled?
|
boolean |
isFatalEnabled()
Is fatal logging currently enabled?
|
boolean |
isInfoEnabled()
Is info logging currently enabled?
|
boolean |
isTraceEnabled()
Is trace logging currently enabled?
|
boolean |
isWarnEnabled()
Is warn logging currently enabled?
|
void |
trace(CharSequence message)
Log a message with trace log level.
|
void |
trace(Supplier<? extends CharSequence> messageSupplier)
Log a message with trace log level.
|
void |
trace(Throwable cause,
CharSequence message)
Log an error with trace log level.
|
void |
trace(Throwable cause,
Supplier<? extends CharSequence> messageSupplier)
Log an error with trace log level.
|
void |
warn(CharSequence message)
Log a message with warn log level.
|
void |
warn(Supplier<? extends CharSequence> messageSupplier)
Log a message with warn log level.
|
void |
warn(Throwable cause,
CharSequence message)
Log an error with warn log level.
|
void |
warn(Throwable cause,
Supplier<? extends CharSequence> messageSupplier)
Log an error with warn log level.
|
public LogAccessor(Log log)
public LogAccessor(Class<?> logCategory)
LogFactory.getLog(Class)
public LogAccessor(String logCategory)
LogFactory.getLog(String)
public final Log getLog()
public boolean isFatalEnabled()
public boolean isErrorEnabled()
public boolean isWarnEnabled()
public boolean isInfoEnabled()
public boolean isDebugEnabled()
public boolean isTraceEnabled()
public void fatal(CharSequence message)
message
- the message to logpublic void fatal(Throwable cause, CharSequence message)
cause
- the exception to logmessage
- the message to logpublic void error(CharSequence message)
message
- the message to logpublic void error(Throwable cause, CharSequence message)
cause
- the exception to logmessage
- the message to logpublic void warn(CharSequence message)
message
- the message to logpublic void warn(Throwable cause, CharSequence message)
cause
- the exception to logmessage
- the message to logpublic void info(CharSequence message)
message
- the message to logpublic void info(Throwable cause, CharSequence message)
cause
- the exception to logmessage
- the message to logpublic void debug(CharSequence message)
message
- the message to logpublic void debug(Throwable cause, CharSequence message)
cause
- the exception to logmessage
- the message to logpublic void trace(CharSequence message)
message
- the message to logpublic void trace(Throwable cause, CharSequence message)
cause
- the exception to logmessage
- the message to logpublic void fatal(Supplier<? extends CharSequence> messageSupplier)
messageSupplier
- a lazy supplier for the message to logpublic void fatal(Throwable cause, Supplier<? extends CharSequence> messageSupplier)
cause
- the exception to logmessageSupplier
- a lazy supplier for the message to logpublic void error(Supplier<? extends CharSequence> messageSupplier)
messageSupplier
- a lazy supplier for the message to logpublic void error(Throwable cause, Supplier<? extends CharSequence> messageSupplier)
cause
- the exception to logmessageSupplier
- a lazy supplier for the message to logpublic void warn(Supplier<? extends CharSequence> messageSupplier)
messageSupplier
- a lazy supplier for the message to logpublic void warn(Throwable cause, Supplier<? extends CharSequence> messageSupplier)
cause
- the exception to logmessageSupplier
- a lazy supplier for the message to logpublic void info(Supplier<? extends CharSequence> messageSupplier)
messageSupplier
- a lazy supplier for the message to logpublic void info(Throwable cause, Supplier<? extends CharSequence> messageSupplier)
cause
- the exception to logmessageSupplier
- a lazy supplier for the message to logpublic void debug(Supplier<? extends CharSequence> messageSupplier)
messageSupplier
- a lazy supplier for the message to logpublic void debug(Throwable cause, Supplier<? extends CharSequence> messageSupplier)
cause
- the exception to logmessageSupplier
- a lazy supplier for the message to logpublic void trace(Supplier<? extends CharSequence> messageSupplier)
messageSupplier
- a lazy supplier for the message to logpublic void trace(Throwable cause, Supplier<? extends CharSequence> messageSupplier)
cause
- the exception to logmessageSupplier
- a lazy supplier for the message to log