Package de.oliver.fancyanalytics.logger
Record Class LogEntry
java.lang.Object
java.lang.Record
de.oliver.fancyanalytics.logger.LogEntry
- Record Components:
loggerName- The name of the logger that created the log entry.logLevel- The severity level of the log entry.message- The log message.timestamp- The time when the log entry was created.properties- A map of additional properties associated with the log entry.
public record LogEntry(@NotNull String loggerName, @NotNull LogLevel logLevel, @NotNull String message, long timestamp, @NotNull Map<String,Object> properties)
extends Record
Represents an individual log entry with details such as log level, message, timestamp,
thread ID, thread name, and an optional throwable.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddProperty(@NotNull String key, @NotNull Object value) final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.@NotNull StringReturns the value of theloggerNamerecord component.@NotNull LogLevellogLevel()Returns the value of thelogLevelrecord component.@NotNull Stringmessage()Returns the value of themessagerecord component.Returns the value of thepropertiesrecord component.longReturns the value of thetimestamprecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
LogEntry
public LogEntry(@NotNull @NotNull String loggerName, @NotNull @NotNull LogLevel logLevel, @NotNull @NotNull String message, long timestamp, @NotNull @NotNull Map<String, Object> properties) Creates an instance of aLogEntryrecord class.- Parameters:
loggerName- the value for theloggerNamerecord componentlogLevel- the value for thelogLevelrecord componentmessage- the value for themessagerecord componenttimestamp- the value for thetimestamprecord componentproperties- the value for thepropertiesrecord component
-
-
Method Details
-
addProperty
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
loggerName
Returns the value of theloggerNamerecord component.- Returns:
- the value of the
loggerNamerecord component
-
logLevel
Returns the value of thelogLevelrecord component.- Returns:
- the value of the
logLevelrecord component
-
message
Returns the value of themessagerecord component.- Returns:
- the value of the
messagerecord component
-
timestamp
public long timestamp()Returns the value of thetimestamprecord component.- Returns:
- the value of the
timestamprecord component
-
properties
Returns the value of thepropertiesrecord component.- Returns:
- the value of the
propertiesrecord component
-