Interface Logger
- All Known Implementing Classes:
LoggerImpl,NoOpLogger,PlainLogger
- Since:
- 1.0.0-SNAPSHOT
-
Method Summary
Modifier and TypeMethodDescriptioncloneWithName(String name) Creates a clone of thisLoggerwith a specified name.default LoggercloneWithName(String format, Object... args) Creates a clone of thisLoggerwith a formatted name.default voidLogs a formatted debug message.voidLogs a debug message.default voidLogs a formatted error message along with the associated throwable.default voidLogs a formatted error message.voidLogs an error message along with the associated throwable.default voidDeprecated, for removal: This API element is subject to removal in a future version.voidLogs an error message.voidLogs an error message along with the associated throwable.default StringUtility method for formatting a string with arguments.default voidLogs a formatted informational message.voidLogs an informational message.default voidLogs a formatted warning message.voidLogs a warning message.
-
Method Details
-
info
Logs an informational message.- Parameters:
text- The text of the informational message to log. It can benull.
-
info
Logs a formatted informational message.This method formats the given string with the specified arguments using
format(String, Object...)before logging it.- Parameters:
format- The format string. Must not benull.args- Arguments referenced by the format specifiers in the format string.- Since:
- 3.5.2
-
warning
Logs a warning message.- Parameters:
text- The text of the warning message to log. It can benull.
-
warning
Logs a formatted warning message.This method formats the given string with the specified arguments using
format(String, Object...)before logging it.- Parameters:
format- The format string. Must not benull.args- Arguments referenced by the format specifiers in the format string.- Since:
- 3.5.2
-
error
Logs an error message.- Parameters:
text- The text of the error message to log. It can benull.
-
error
Logs a formatted error message.This method formats the given string with the specified arguments using
format(String, Object...)before logging it.- Parameters:
format- The format string. Must not benull.args- Arguments referenced by the format specifiers in the format string.- Since:
- 3.5.2
-
error
Logs an error message along with the associated throwable.- Parameters:
throwable- TheThrowableobject representing the error. Must not benull.
-
error
@Deprecated(since="3.5.2", forRemoval=true) default void error(@NotNull @NotNull Throwable throwable, @Nullable @Nullable String comment) Deprecated, for removal: This API element is subject to removal in a future version.Logs an error message along with the associated throwable and additional comment.- Parameters:
throwable- TheThrowableobject representing the error. Must not benull.comment- Additional comment or context for the error. It can benull.
-
error
Logs an error message along with the associated throwable.- Parameters:
message- A descriptive message for the error. It can benull.throwable- TheThrowableobject representing the error. Must not benull.- Since:
- 3.5.2
-
error
default void error(@NotNull @NotNull String format, @NotNull @NotNull Throwable throwable, Object... args) Logs a formatted error message along with the associated throwable.This method formats the given string with the specified arguments using
format(String, Object...)before logging it together with the provided throwable.- Parameters:
format- The format string. Must not benull.throwable- TheThrowableobject representing the error. Must not benull.args- Arguments referenced by the format specifiers in the format string.- Since:
- 3.5.2
-
debug
Logs a debug message.- Parameters:
text- The text of the debug message to log. It can benull.
-
debug
Logs a formatted debug message.This method formats the given string with the specified arguments using
format(String, Object...)before logging it.- Parameters:
format- The format string. Must not benull.args- Arguments referenced by the format specifiers in the format string.- Since:
- 3.5.2
-
cloneWithName
Creates a clone of thisLoggerwith a specified name.- Parameters:
name- The name for the cloned logger.- Returns:
- A new
Loggerinstance cloned from this logger with the given name.
-
cloneWithName
Creates a clone of thisLoggerwith a formatted name.The provided format string and arguments are combined into a name using
format(String, Object...), which is then used to create the cloned logger.- Parameters:
format- The format string used for the logger name. Must not benull.args- Arguments referenced by the format specifiers in the format string.- Returns:
- A new
Loggerinstance cloned from this logger with the formatted name. - Since:
- 3.5.2
-
format
Utility method for formatting a string with arguments.This method simply delegates to
String.format(String, Object...).- Parameters:
format- The format string. Must not benull.args- Arguments referenced by the format specifiers in the format string.- Returns:
- A formatted string.
- Since:
- 3.5.2
-
error(String, Throwable)