Record Class NoOpLogger
java.lang.Object
java.lang.Record
de.craftsblock.craftsnet.logging.impl.NoOpLogger
- All Implemented Interfaces:
Logger
An implementation of the
Logger interface that performs no operations.
The NoOpLogger simply accepts log messages and errors but does not process
them in any way.- Since:
- 3.4.0-SNAPSHOT
-
Constructor Summary
ConstructorsConstructorDescriptionNoOpLogger(Logger previous) Constructs anNoOpLoggerwith 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.Utility method for formatting a string with arguments.final inthashCode()Returns a hash code value for this object.voidLogs an informational message.previous()Returns the value of thepreviousrecord component.final StringtoString()Returns a string representation of this record class.voidLogs a warning message.
-
Constructor Details
-
NoOpLogger
Constructs anNoOpLoggerwith a reference to a previousLogger.- Parameters:
previous- the previousLoggerin the chain, can be used for chaining or fallback purposes.
-
-
Method Details
-
info
Logs an informational message. This implementation does nothing. -
warning
Logs a warning message. This implementation does nothing. -
error
Logs an error message. This implementation does nothing. -
error
Logs an error message along with the associated throwable. This implementation does nothing. -
error
Logs an error message along with the associated throwable. This implementation does nothing. -
debug
Logs a debug message. This implementation does nothing. -
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.
-
format
Utility method for formatting a string with arguments.This method just returns the unformatted format as this logger has no actions.
-
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). -
previous
Returns the value of thepreviousrecord component.- Returns:
- the value of the
previousrecord component
-