Record Class PlainLogger
java.lang.Object
java.lang.Record
de.craftsblock.craftsnet.logging.impl.PlainLogger
- All Implemented Interfaces:
Logger
An implementation of the
Logger interface that prints the result
in the System.out or the System.err stream, without any
further formating.- Since:
- 3.1.0-SNAPSHOT
-
Constructor Summary
ConstructorsConstructorDescriptionPlainLogger(Logger previous) Constructs anPlainLoggerwith a reference to a previousLogger. -
Method Summary
Modifier and TypeMethodDescriptioncloneWithName(String name) Creates a clone of thisLoggerwith a specified name.voidLogs a debug message.final booleanIndicates whether some other object is "equal to" this one.voidLogs an error message along with the associated throwable.voidLogs an error message.voidLogs an error message along with the associated throwable.final inthashCode()Returns a hash code value for this object.voidLogs an informational message.previous()Returns the previousLoggerin the chain.final StringtoString()Returns a string representation of this record class.voidLogs a warning message.
-
Constructor Details
-
PlainLogger
Constructs anPlainLoggerwith a reference to a previousLogger.- Parameters:
previous- the previousLoggerin the chain, can be used for chaining or fallback purposes.
-
-
Method Details
-
previous
Returns the previousLoggerin the chain. This can be used to access the logger that was previously used before thisPlainLogger.- Returns:
- The previous
Loggerinstance.
-
info
Logs an informational message. -
warning
Logs a warning message. -
error
Logs an error message. -
error
Logs an error message along with the associated throwable. -
error
Logs an error message along with the associated throwable. -
debug
Logs a debug message. -
cloneWithName
Creates a clone of thisLoggerwith a specified name.- Specified by:
cloneWithNamein interfaceLogger- Parameters:
name- The name for the cloned logger. (Not used in any way!)- Returns:
- A new
Loggerinstance cloned from this logger with the given name.
-
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).
-