serialize

open override fun <T : PureeLog> serialize(log: T, platformClass: PlatformClass<T>): JsonObject

Serializes a log object into JSON format using Kotlin's serialization library.

This implementation uses the kotlinx.serialization framework to convert the log object to JSON. It retrieves the appropriate serializer for the log type using the KClass reference from the platformClass parameter, then encodes the log object to a JSON element and returns its jsonObject property.

Return

The serialized log as a JsonObject.

Parameters

log

The log object to be serialized.

platformClass

The platform-specific class information for the log type.