Package cimerant.logger
Record Class LogRecord
java.lang.Object
java.lang.Record
cimerant.logger.LogRecord
- Record Components:
nanoTime- message time in nanoseconds.loggerName- logger name associated with the message.level-Levelassociated with the message.marker-Markerassociated with the message.message- message associated with the log.exception-Throwableassociated with the log.
public record LogRecord(long nanoTime, String loggerName, Level level, Marker marker, String message, Throwable exception)
extends Record
The
LogRecord class represents the message and associated data at the time of logging.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.Returns the value of theexceptionrecord component.final inthashCode()Returns a hash code value for this object.level()Returns the value of thelevelrecord component.Returns the value of theloggerNamerecord component.marker()Returns the value of themarkerrecord component.message()Returns the value of themessagerecord component.longnanoTime()Returns the value of thenanoTimerecord component.toString()Returns a string representation of the object.
-
Constructor Details
-
LogRecord
public LogRecord(long nanoTime, String loggerName, Level level, Marker marker, String message, Throwable exception) Creates an instance of aLogRecordrecord class.- Parameters:
nanoTime- the value for thenanoTimerecord componentloggerName- the value for theloggerNamerecord componentlevel- the value for thelevelrecord componentmarker- the value for themarkerrecord componentmessage- the value for themessagerecord componentexception- the value for theexceptionrecord component
-
-
Method Details
-
toString
Returns a string representation of the object. -
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
nanoTime
public long nanoTime()Returns the value of thenanoTimerecord component.- Returns:
- the value of the
nanoTimerecord component
-
loggerName
Returns the value of theloggerNamerecord component.- Returns:
- the value of the
loggerNamerecord component
-
level
Returns the value of thelevelrecord component.- Returns:
- the value of the
levelrecord component
-
marker
Returns the value of themarkerrecord component.- Returns:
- the value of the
markerrecord component
-
message
Returns the value of themessagerecord component.- Returns:
- the value of the
messagerecord component
-
exception
Returns the value of theexceptionrecord component.- Returns:
- the value of the
exceptionrecord component
-