public final class Logger
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static void |
debug(java.lang.String message)
Logs a
DEBUG message. |
static void |
debug(java.lang.String message,
java.lang.Object... arguments)
Logs a
DEBUG message with the given arguments. |
static void |
debug(java.lang.String message,
java.util.function.Supplier<java.lang.String> parameterSupplier)
Logs an
ERROR message with a given lazy calculated parameter. |
static void |
debug(java.lang.String message,
java.lang.Throwable exception)
Logs a
DEBUG message with the given exception. |
static void |
debug(java.util.function.Supplier<java.lang.String> msgSupplier)
Logs a lazily constructed
DEBUG message. |
static void |
error(java.lang.String message)
Logs an
ERROR message. |
static void |
error(java.lang.String message,
java.lang.Object... arguments)
Logs an
ERROR message with the given arguments. |
static void |
error(java.lang.String message,
java.lang.Throwable exception)
Logs an
ERROR message with the given exception. |
static void |
error(java.lang.String message,
java.lang.Throwable exception,
java.lang.Object... arguments)
Logs an
ERROR message with the given exception and arguments. |
static void |
error(java.lang.String message,
java.lang.Throwable exception,
java.util.function.Supplier<java.lang.String> parameterSupplier)
Logs an
ERROR message with the given exception and a lazy calculated parameter. |
static void |
info(java.lang.String message)
Logs an
INFO message. |
static void |
info(java.lang.String message,
java.lang.Object... arguments)
Logs an
INFO message with the given arguments. |
static boolean |
isDebugEnabled()
Checks whether log entries at
DEBUG level will be output. |
static boolean |
isErrorEnabled()
Checks whether log entries at
ERROR level will be output. |
static boolean |
isInfoEnabled()
Checks whether log entries at
INFO level will be output. |
static boolean |
isTraceEnabled()
Checks whether log entries at
TRACE level will be output. |
static boolean |
isWarnEnabled()
Checks whether log entries at
WARNING level will be output. |
static Level |
level()
Returns the current log level specifying which message levels will be logged.
|
static void |
level(Level level)
Sets the log level specifying which message levels will be logged.
|
static void |
off()
Disables logging by setting the log level to
Level.OFF . |
static void |
trace(java.lang.String message,
java.lang.Object... arguments)
Logs a
TRACE message with the given arguments. |
static void |
trace(java.util.function.Supplier<java.lang.String> msgSupplier)
Logs a lazily constructed
TRACE message. |
static void |
warn(java.lang.String message)
Logs a
WARNING message. |
static void |
warn(java.lang.String message,
java.lang.Object... arguments)
Logs a
WARNING message with the given arguments. |
static void |
warn(java.lang.String message,
java.lang.Throwable exception)
Logs a
WARNING message with the given exception. |
static void |
warn(java.lang.Throwable exception,
java.util.function.Supplier<java.lang.String> msgSupplier)
Logs a lazily constructed
WARNING message with the given exception. |
public static Level level()
public static void level(Level level)
Level.OFF
value can be used to turn off logging.level
- the new value for the log levelpublic static void off()
Level.OFF
.public static void error(java.lang.String message)
ERROR
message.message
- the message to logpublic static void error(java.lang.String message, java.lang.Object... arguments)
ERROR
message with the given arguments.message
- the message to logarguments
- the array of arguments to the messagepublic static void error(java.lang.String message, java.lang.Throwable exception)
ERROR
message with the given exception.message
- the message to logexception
- the Throwable
associated with the log messagepublic static void error(java.lang.String message, java.lang.Throwable exception, java.util.function.Supplier<java.lang.String> parameterSupplier)
ERROR
message with the given exception and a lazy calculated parameter.message
- the message to logexception
- the Throwable
associated with the log messageparameterSupplier
- a function, which when called, produces the desired log message
parameterpublic static void error(java.lang.String message, java.lang.Throwable exception, java.lang.Object... arguments)
ERROR
message with the given exception and arguments.message
- the message to logexception
- the Throwable
associated with the log messagearguments
- the array of arguments to the messagepublic static void info(java.lang.String message)
INFO
message.message
- the message to logpublic static void info(java.lang.String message, java.lang.Object... arguments)
INFO
message with the given arguments.message
- the message to logarguments
- the array of arguments to the messagepublic static void warn(java.lang.String message)
WARNING
message.message
- the message to logpublic static void warn(java.lang.String message, java.lang.Object... arguments)
WARNING
message with the given arguments.message
- the message to logarguments
- the array of arguments to the messagepublic static void warn(java.lang.String message, java.lang.Throwable exception)
WARNING
message with the given exception.message
- the message to logexception
- the Throwable
associated with the log messagepublic static void warn(java.lang.Throwable exception, java.util.function.Supplier<java.lang.String> msgSupplier)
WARNING
message with the given exception.exception
- the Throwable
associated with the log messagemsgSupplier
- a function, which when called, produces the desired log messagepublic static void debug(java.lang.String message)
DEBUG
message.message
- the message to logpublic static void debug(java.lang.String message, java.lang.Throwable exception)
DEBUG
message with the given exception.message
- the message to logexception
- the Throwable
associated with the log messagepublic static void debug(java.util.function.Supplier<java.lang.String> msgSupplier)
DEBUG
message.msgSupplier
- a function, which when called, produces the desired log messagepublic static void debug(java.lang.String message, java.lang.Object... arguments)
DEBUG
message with the given arguments.message
- the message to logarguments
- the array of arguments to the messagepublic static void debug(java.lang.String message, java.util.function.Supplier<java.lang.String> parameterSupplier)
ERROR
message with a given lazy calculated parameter.message
- the message to logparameterSupplier
- a function, which when called, produces the desired log message
parameterpublic static void trace(java.lang.String message, java.lang.Object... arguments)
TRACE
message with the given arguments.message
- the message to logarguments
- the array of arguments to the messagepublic static void trace(java.util.function.Supplier<java.lang.String> msgSupplier)
TRACE
message.msgSupplier
- a function, which when called, produces the desired log messagepublic static boolean isErrorEnabled()
ERROR
level will be output.public static boolean isWarnEnabled()
WARNING
level will be output.public static boolean isInfoEnabled()
INFO
level will be output.public static boolean isDebugEnabled()
DEBUG
level will be output.public static boolean isTraceEnabled()
TRACE
level will be output.