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 - Level associated with the message.
marker - Marker associated with the message.
message - message associated with the log.
exception - Throwable associated 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 Details

    • LogRecord

      public LogRecord(long nanoTime, String loggerName, Level level, Marker marker, String message, Throwable exception)
      Creates an instance of a LogRecord record class.
      Parameters:
      nanoTime - the value for the nanoTime record component
      loggerName - the value for the loggerName record component
      level - the value for the level record component
      marker - the value for the marker record component
      message - the value for the message record component
      exception - the value for the exception record component
  • Method Details

    • toString

      public String toString()
      Returns a string representation of the object.
      Specified by:
      toString in class Record
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • nanoTime

      public long nanoTime()
      Returns the value of the nanoTime record component.
      Returns:
      the value of the nanoTime record component
    • loggerName

      public String loggerName()
      Returns the value of the loggerName record component.
      Returns:
      the value of the loggerName record component
    • level

      public Level level()
      Returns the value of the level record component.
      Returns:
      the value of the level record component
    • marker

      public Marker marker()
      Returns the value of the marker record component.
      Returns:
      the value of the marker record component
    • message

      public String message()
      Returns the value of the message record component.
      Returns:
      the value of the message record component
    • exception

      public Throwable exception()
      Returns the value of the exception record component.
      Returns:
      the value of the exception record component