Record Class ExtensionLogger
java.lang.Object
java.lang.Record
com.booksaw.betterTeams.extension.ExtensionLogger
- Record Components:
logger- The underlyingLoggerinstanceprefix- The formatted prefix
A simple logger wrapper that prepends a fixed, formatted prefix
This utility ensures that all output from a specific extension is
clearly identifiable in the server console.
-
Constructor Summary
ConstructorsConstructorDescriptionExtensionLogger(@NotNull Logger logger, @NotNull String prefix) Creates an instance of aExtensionLoggerrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.voidLogs an INFO message.voidLogs a message at the specified level.voidLogs a message at the specified level with an associated exception.logger()Returns the value of theloggerrecord component.prefix()Returns the value of theprefixrecord component.voidLogs an SEVERE message.final StringtoString()Returns a string representation of this record class.voidLogs an WARNING message.
-
Constructor Details
-
Method Details
-
info
Logs an INFO message.- Parameters:
msg- The message to log.
-
warning
Logs an WARNING message.- Parameters:
msg- The message to log.
-
severe
Logs an SEVERE message.- Parameters:
msg- The message to log.
-
log
Logs a message at the specified level.- Parameters:
level- The log level (e.g.,Level.INFO).msg- The message to log.
-
log
public void log(@NotNull @NotNull Level level, @NotNull @NotNull String msg, @NotNull @NotNull Throwable thrown) Logs a message at the specified level with an associated exception.- Parameters:
level- The log level (e.g.,Level.SEVERE).msg- The message to log.thrown- TheThrowableto log.
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
logger
Returns the value of theloggerrecord component.- Returns:
- the value of the
loggerrecord component
-
prefix
Returns the value of theprefixrecord component.- Returns:
- the value of the
prefixrecord component
-