LogMessage

class LogMessage(val message: LogMessageContent, val details: String? = null, val type: LogMessageType = message.inferType(), val location: String? = null, val pubNubId: String? = null, val logLevel: Level? = null, val timestamp: String = LocalTime.now().format(DateTimeFormatter.ofPattern("HH:mm:ss.SSS")))

Represents a structured log message with validation and sanitization.

Parameters

pubNubId

The PubNub instance identifier

logLevel

The logging level

location

The source location of the log

type

The type of log message (automatically inferred from message content)

message

The log message content

details

Optional additional details (will be sanitized)

timestamp

The timestamp when the log was created

Constructors

Link copied to clipboard
constructor(message: LogMessageContent, details: String? = null, type: LogMessageType = message.inferType(), location: String? = null, pubNubId: String? = null, logLevel: Level? = null, timestamp: String = LocalTime.now().format(DateTimeFormatter.ofPattern("HH:mm:ss.SSS")))

Properties

Link copied to clipboard
@SerializedName(value = "details")
val details: String?
Link copied to clipboard
@SerializedName(value = "location")
val location: String?
Link copied to clipboard
@SerializedName(value = "logLevel")
val logLevel: Level?
Link copied to clipboard
@SerializedName(value = "message")
val message: LogMessageContent
Link copied to clipboard
@SerializedName(value = "pubNubId")
val pubNubId: String?
Link copied to clipboard
@SerializedName(value = "timestamp")
val timestamp: String
Link copied to clipboard
@SerializedName(value = "type")
val type: LogMessageType