public final class Logger extends Object
Modifier and Type | Method and Description |
---|---|
static void |
debug(Object message)
Logs a message at
DEBUG level. |
static void |
debug(String message,
Object... arguments)
Logs a formatted message at
DEBUG level. |
static void |
debug(String message,
Supplier<?>... arguments)
Logs a formatted message at
DEBUG level. |
static void |
debug(Supplier<?> message)
Logs a lazy message at
DEBUG level. |
static void |
debug(Throwable exception)
Logs an exception at
DEBUG level. |
static void |
debug(Throwable exception,
String message)
Logs an exception with a custom message at
DEBUG level. |
static void |
debug(Throwable exception,
String message,
Object... arguments)
Logs an exception with a formatted custom message at
DEBUG level. |
static void |
debug(Throwable exception,
String message,
Supplier<?>... arguments)
Logs an exception with a formatted message at
DEBUG level. |
static void |
debug(Throwable exception,
Supplier<String> message)
Logs an exception with a custom lazy message at
DEBUG level. |
static void |
error(Object message)
Logs a message at
ERROR level. |
static void |
error(String message,
Object... arguments)
Logs a formatted message at
ERROR level. |
static void |
error(String message,
Supplier<?>... arguments)
Logs a formatted message at
ERROR level. |
static void |
error(Supplier<?> message)
Logs a lazy message at
ERROR level. |
static void |
error(Throwable exception)
Logs an exception at
ERROR level. |
static void |
error(Throwable exception,
String message)
Logs an exception with a custom message at
ERROR level. |
static void |
error(Throwable exception,
String message,
Object... arguments)
Logs an exception with a formatted custom message at
ERROR level. |
static void |
error(Throwable exception,
String message,
Supplier<?>... arguments)
Logs an exception with a formatted message at
ERROR level. |
static void |
error(Throwable exception,
Supplier<String> message)
Logs an exception with a custom lazy message at
ERROR level. |
static void |
info(Object message)
Logs a message at
INFO level. |
static void |
info(String message,
Object... arguments)
Logs a formatted message at
INFO level. |
static void |
info(String message,
Supplier<?>... arguments)
Logs a formatted message at
INFO level. |
static void |
info(Supplier<?> message)
Logs a lazy message at
INFO level. |
static void |
info(Throwable exception)
Logs an exception at
INFO level. |
static void |
info(Throwable exception,
String message)
Logs an exception with a custom message at
INFO level. |
static void |
info(Throwable exception,
String message,
Object... arguments)
Logs an exception with a formatted custom message at
INFO level. |
static void |
info(Throwable exception,
String message,
Supplier<?>... arguments)
Logs an exception with a formatted message at
INFO level. |
static void |
info(Throwable exception,
Supplier<String> message)
Logs an exception with a custom lazy message at
INFO level. |
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
WARN level will be output. |
static TaggedLogger |
tag(String tag)
Gets a tagged logger instance.
|
static TaggedLogger |
tags(String... tags)
Gets a tagged logger instance that logs to multiple tags.
|
static void |
trace(Object message)
Logs a message at
TRACE level. |
static void |
trace(String message,
Object... arguments)
Logs a formatted message at
TRACE level. |
static void |
trace(String message,
Supplier<?>... arguments)
Logs a formatted message at
TRACE level. |
static void |
trace(Supplier<?> message)
Logs a lazy message at
TRACE level. |
static void |
trace(Throwable exception)
Logs an exception at
TRACE level. |
static void |
trace(Throwable exception,
String message)
Logs an exception with a custom message at
TRACE level. |
static void |
trace(Throwable exception,
String message,
Object... arguments)
Logs an exception with a formatted custom message at
TRACE level. |
static void |
trace(Throwable exception,
String message,
Supplier<?>... arguments)
Logs an exception with a formatted message at
TRACE level. |
static void |
trace(Throwable exception,
Supplier<String> message)
Logs an exception with a custom lazy message at
TRACE level. |
static void |
warn(Object message)
Logs a message at
WARN level. |
static void |
warn(String message,
Object... arguments)
Logs a formatted message at
WARN level. |
static void |
warn(String message,
Supplier<?>... arguments)
Logs a formatted message at
WARN level. |
static void |
warn(Supplier<?> message)
Logs a lazy message at
WARN level. |
static void |
warn(Throwable exception)
Logs an exception at
WARN level. |
static void |
warn(Throwable exception,
String message)
Logs an exception with a custom message at
WARN level. |
static void |
warn(Throwable exception,
String message,
Object... arguments)
Logs an exception with a formatted custom message at
WARN level. |
static void |
warn(Throwable exception,
String message,
Supplier<?>... arguments)
Logs an exception with a formatted message at
WARN level. |
static void |
warn(Throwable exception,
Supplier<String> message)
Logs an exception with a custom lazy message at
WARN level. |
public static TaggedLogger tag(String tag)
tag
- Tag for logger or null
for receiving an untagged loggerpublic static TaggedLogger tags(String... tags)
tags
- Tags for the logger or nothing for an untagged logger. If specified, each tag should be uniquepublic static boolean isTraceEnabled()
TRACE
level will be output.true
if TRACE
level is enabled, false
if disabledpublic static void trace(Object message)
TRACE
level.message
- String or any other object with a meaningful Object.toString()
methodpublic static void trace(Supplier<?> message)
TRACE
level. The message will be only evaluated if the log entry is
really output.message
- Function that produces the messagepublic static void trace(String message, Object... arguments)
TRACE
level. "{}" placeholders will be replaced by given
arguments.message
- Formatted text message to logarguments
- Arguments for formatted text messagepublic static void trace(String message, Supplier<?>... arguments)
TRACE
level. "{}" placeholders will be replaced by given lazy
arguments. The arguments will be only evaluated if the log entry is really output.message
- Formatted text message to logarguments
- Functions that produce the arguments for formatted text messagepublic static void trace(Throwable exception)
TRACE
level.exception
- Caught exception or any other throwable to logpublic static void trace(Throwable exception, String message)
TRACE
level.exception
- Caught exception or any other throwable to logmessage
- Text message to logpublic static void trace(Throwable exception, Supplier<String> message)
TRACE
level. The message will be only
evaluated if the log entry is really output.exception
- Caught exception or any other throwable to logmessage
- Function that produces the messagepublic static void trace(Throwable exception, String message, Object... arguments)
TRACE
level. "{}" placeholders will be
replaced by given arguments.exception
- Caught exception or any other throwable to logmessage
- Formatted text message to logarguments
- Arguments for formatted text messagepublic static void trace(Throwable exception, String message, Supplier<?>... arguments)
TRACE
level. "{}" placeholders will be replaced
by given lazy arguments. The arguments will be only evaluated if the log entry is really output.exception
- Caught exception or any other throwable to logmessage
- Formatted text message to logarguments
- Functions that produce the arguments for formatted text messagepublic static boolean isDebugEnabled()
DEBUG
level will be output.true
if DEBUG
level is enabled, false
if disabledpublic static void debug(Object message)
DEBUG
level.message
- String or any other object with a meaningful Object.toString()
methodpublic static void debug(Supplier<?> message)
DEBUG
level. The message will be only evaluated if the log entry is
really output.message
- Function that produces the messagepublic static void debug(String message, Object... arguments)
DEBUG
level. "{}" placeholders will be replaced by given
arguments.message
- Formatted text message to logarguments
- Arguments for formatted text messagepublic static void debug(String message, Supplier<?>... arguments)
DEBUG
level. "{}" placeholders will be replaced by given lazy
arguments. The arguments will be only evaluated if the log entry is really output.message
- Formatted text message to logarguments
- Functions that produce the arguments for formatted text messagepublic static void debug(Throwable exception)
DEBUG
level.exception
- Caught exception or any other throwable to logpublic static void debug(Throwable exception, String message)
DEBUG
level.exception
- Caught exception or any other throwable to logmessage
- Text message to logpublic static void debug(Throwable exception, Supplier<String> message)
DEBUG
level. The message will be only
evaluated if the log entry is really output.exception
- Caught exception or any other throwable to logmessage
- Function that produces the messagepublic static void debug(Throwable exception, String message, Object... arguments)
DEBUG
level. "{}" placeholders will be
replaced by given arguments.exception
- Caught exception or any other throwable to logmessage
- Formatted text message to logarguments
- Arguments for formatted text messagepublic static void debug(Throwable exception, String message, Supplier<?>... arguments)
DEBUG
level. "{}" placeholders will be replaced
by given lazy arguments. The arguments will be only evaluated if the log entry is really output.exception
- Caught exception or any other throwable to logmessage
- Formatted text message to logarguments
- Functions that produce the arguments for formatted text messagepublic static boolean isInfoEnabled()
INFO
level will be output.true
if INFO
level is enabled, false
if disabledpublic static void info(Object message)
INFO
level.message
- String or any other object with a meaningful Object.toString()
methodpublic static void info(Supplier<?> message)
INFO
level. The message will be only evaluated if the log entry is
really output.message
- Function that produces the messagepublic static void info(String message, Object... arguments)
INFO
level. "{}" placeholders will be replaced by given arguments.message
- Formatted text message to logarguments
- Arguments for formatted text messagepublic static void info(String message, Supplier<?>... arguments)
INFO
level. "{}" placeholders will be replaced by given lazy
arguments. The arguments will be only evaluated if the log entry is really output.message
- Formatted text message to logarguments
- Functions that produce the arguments for formatted text messagepublic static void info(Throwable exception)
INFO
level.exception
- Caught exception or any other throwable to logpublic static void info(Throwable exception, String message)
INFO
level.exception
- Caught exception or any other throwable to logmessage
- Text message to logpublic static void info(Throwable exception, Supplier<String> message)
INFO
level. The message will be only evaluated
if the log entry is really output.exception
- Caught exception or any other throwable to logmessage
- Function that produces the messagepublic static void info(Throwable exception, String message, Object... arguments)
INFO
level. "{}" placeholders will be
replaced by given arguments.exception
- Caught exception or any other throwable to logmessage
- Formatted text message to logarguments
- Arguments for formatted text messagepublic static void info(Throwable exception, String message, Supplier<?>... arguments)
INFO
level. "{}" placeholders will be replaced
by given lazy arguments. The arguments will be only evaluated if the log entry is really output.exception
- Caught exception or any other throwable to logmessage
- Formatted text message to logarguments
- Functions that produce the arguments for formatted text messagepublic static boolean isWarnEnabled()
WARN
level will be output.true
if WARN
level is enabled, false
if disabledpublic static void warn(Object message)
WARN
level.message
- String or any other object with a meaningful Object.toString()
methodpublic static void warn(Supplier<?> message)
WARN
level. The message will be only evaluated if the log entry
is really output.message
- Function that produces the messagepublic static void warn(String message, Object... arguments)
WARN
level. "{}" placeholders will be replaced by given
arguments.message
- Formatted text message to logarguments
- Arguments for formatted text messagepublic static void warn(String message, Supplier<?>... arguments)
WARN
level. "{}" placeholders will be replaced by given lazy
arguments. The arguments will be only evaluated if the log entry is really output.message
- Formatted text message to logarguments
- Functions that produce the arguments for formatted text messagepublic static void warn(Throwable exception)
WARN
level.exception
- Caught exception or any other throwable to logpublic static void warn(Throwable exception, String message)
WARN
level.exception
- Caught exception or any other throwable to logmessage
- Text message to logpublic static void warn(Throwable exception, Supplier<String> message)
WARN
level. The message will be only
evaluated if the log entry is really output.exception
- Caught exception or any other throwable to logmessage
- Function that produces the messagepublic static void warn(Throwable exception, String message, Object... arguments)
WARN
level. "{}" placeholders will
be replaced by given arguments.exception
- Caught exception or any other throwable to logmessage
- Formatted text message to logarguments
- Arguments for formatted text messagepublic static void warn(Throwable exception, String message, Supplier<?>... arguments)
WARN
level. "{}" placeholders will be
replaced by given lazy arguments. The arguments will be only evaluated if the log entry is really output.exception
- Caught exception or any other throwable to logmessage
- Formatted text message to logarguments
- Functions that produce the arguments for formatted text messagepublic static boolean isErrorEnabled()
ERROR
level will be output.true
if ERROR
level is enabled, false
if disabledpublic static void error(Object message)
ERROR
level.message
- String or any other object with a meaningful Object.toString()
methodpublic static void error(Supplier<?> message)
ERROR
level. The message will be only evaluated if the log entry is
really output.message
- Function that produces the messagepublic static void error(String message, Object... arguments)
ERROR
level. "{}" placeholders will be replaced by given
arguments.message
- Formatted text message to logarguments
- Arguments for formatted text messagepublic static void error(String message, Supplier<?>... arguments)
ERROR
level. "{}" placeholders will be replaced by given lazy
arguments. The arguments will be only evaluated if the log entry is really output.message
- Formatted text message to logarguments
- Functions that produce the arguments for formatted text messagepublic static void error(Throwable exception)
ERROR
level.exception
- Caught exception or any other throwable to logpublic static void error(Throwable exception, String message)
ERROR
level.exception
- Caught exception or any other throwable to logmessage
- Text message to logpublic static void error(Throwable exception, Supplier<String> message)
ERROR
level. The message will be only
evaluated if the log entry is really output.exception
- Caught exception or any other throwable to logmessage
- Function that produces the messagepublic static void error(Throwable exception, String message, Object... arguments)
ERROR
level. "{}" placeholders will be
replaced by given arguments.exception
- Caught exception or any other throwable to logmessage
- Formatted text message to logarguments
- Arguments for formatted text messagepublic static void error(Throwable exception, String message, Supplier<?>... arguments)
ERROR
level. "{}" placeholders will be replaced
by given lazy arguments. The arguments will be only evaluated if the log entry is really output.exception
- Caught exception or any other throwable to logmessage
- Formatted text message to logarguments
- Functions that produce the arguments for formatted text messageCopyright © 2024. All rights reserved.