Record Class ScxLogRecord

java.lang.Object
java.lang.Record
cool.scx.logging.ScxLogRecord

public record ScxLogRecord(LocalDateTime timeStamp, System.Logger.Level level, String loggerName, String message, String threadName, Throwable throwable, StackTraceElement[] contextStack) extends Record
日志记录
Version:
0.0.1
Author:
scx567888
  • Constructor Details

    • ScxLogRecord

      public ScxLogRecord(LocalDateTime timeStamp, System.Logger.Level level, String loggerName, String message, String threadName, Throwable throwable, StackTraceElement[] contextStack)
      Creates an instance of a ScxLogRecord record class.
      Parameters:
      timeStamp - the value for the timeStamp record component
      level - the value for the level record component
      loggerName - the value for the loggerName record component
      message - the value for the message record component
      threadName - the value for the threadName record component
      throwable - the value for the throwable record component
      contextStack - the value for the contextStack record component
  • Method Details

    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this 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.
      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. All components in this record class are compared with Objects::equals(Object,Object).
      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.
    • timeStamp

      public LocalDateTime timeStamp()
      Returns the value of the timeStamp record component.
      Returns:
      the value of the timeStamp record component
    • level

      public System.Logger.Level level()
      Returns the value of the level record component.
      Returns:
      the value of the level record component
    • loggerName

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

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

      public String threadName()
      Returns the value of the threadName record component.
      Returns:
      the value of the threadName record component
    • throwable

      public Throwable throwable()
      Returns the value of the throwable record component.
      Returns:
      the value of the throwable record component
    • contextStack

      public StackTraceElement[] contextStack()
      Returns the value of the contextStack record component.
      Returns:
      the value of the contextStack record component