public interface Logger
Logger interface.| Modifier and Type | Method and Description |
|---|---|
void |
debug(Object message)
Output a debug message.
|
default void |
debug(Supplier<Object> messageSupplier)
Output a debug message supplied by a
Supplier function. |
void |
error(Object message)
Output an error message.
|
void |
error(Object message,
Throwable throwable)
Output an error message along with a
Throwable. |
default void |
error(Supplier<Object> messageSupplier)
Output an error message supplied by a
Supplier function. |
default void |
error(Supplier<Object> messageSupplier,
Throwable throwable)
|
static Logger |
getDefault(Class<?> javaClass)
Get a default
Logger for the supplied Java Class. |
static Logger |
getDefault(String name)
Get a default
Logger with the supplied name. |
String |
getName()
Get the name associated with this
Logger. |
void |
info(Object message)
Output an info message.
|
default void |
info(Supplier<Object> messageSupplier)
Output an info message supplied by a
Supplier function. |
boolean |
isDebugEnabled()
Test whether debug output is enabled for this
Logger. |
boolean |
isErrorEnabled()
Test whether error output is enabled for this
Logger. |
boolean |
isInfoEnabled()
Test whether info output is enabled for this
Logger. |
boolean |
isTraceEnabled()
Test whether trace output is enabled for this
Logger. |
boolean |
isWarnEnabled()
Test whether warning output is enabled for this
Logger. |
default void |
log(Level level,
Object message)
Output a message with a variable level.
|
default void |
log(Level level,
Supplier<Object> messageSupplier)
Output a message supplied by a
Supplier function, with a variable level. |
void |
trace(Object message)
Output a trace message.
|
default void |
trace(Supplier<Object> messageSupplier)
Output a trace message supplied by a
Supplier function. |
void |
warn(Object message)
Output a warning message.
|
default void |
warn(Supplier<Object> messageSupplier)
Output a warning message supplied by a
Supplier function. |
String getName()
Logger.boolean isTraceEnabled()
Logger.true if trace output is enabledboolean isDebugEnabled()
Logger.true if debug output is enabledboolean isInfoEnabled()
Logger.true if info output is enabledboolean isWarnEnabled()
Logger.true if warning output is enabledboolean isErrorEnabled()
Logger.true if error output is enabledvoid trace(Object message)
message - the message (will be output using Object.toString()void debug(Object message)
message - the message (will be output using Object.toString()void info(Object message)
message - the message (will be output using Object.toString()void warn(Object message)
message - the message (will be output using Object.toString()void error(Object message)
message - the message (will be output using Object.toString()void error(Object message, Throwable throwable)
Throwable.message - the message (will be output using Object.toString()throwable - the Throwabledefault void trace(Supplier<Object> messageSupplier)
Supplier function. The function will only be called if the logging
level is enabled.messageSupplier - the message supplierdefault void debug(Supplier<Object> messageSupplier)
Supplier function. The function will only be called if the logging
level is enabled.messageSupplier - the message supplierdefault void info(Supplier<Object> messageSupplier)
Supplier function. The function will only be called if the logging
level is enabled.messageSupplier - the message supplierdefault void warn(Supplier<Object> messageSupplier)
Supplier function. The function will only be called if the
logging level is enabled.messageSupplier - the message supplierdefault void error(Supplier<Object> messageSupplier)
Supplier function. The function will only be called if the logging
level is enabled.messageSupplier - the message supplierdefault void error(Supplier<Object> messageSupplier, Throwable throwable)
Supplier function, along with a Throwable. The function
will only be called if the logging level is enabled.messageSupplier - the message supplierthrowable - the Throwabledefault void log(Level level, Object message)
level - the Levelmessage - the message (will be output using Object.toString()default void log(Level level, Supplier<Object> messageSupplier)
Supplier function, with a variable level. The function will only be
called if the logging level is enabled.level - the LevelmessageSupplier - the message supplierstatic Logger getDefault(String name)
Logger with the supplied name.name - the nameLoggerCopyright © 2021. All rights reserved.