All Downloads are FREE. Search and download functionalities are using the official Maven repository.

nativeJsMain.org.jetbrains.skia.skottie.Logger.nativejs.kt Maven / Gradle / Ivy

There is a newer version: 0.8.15
Show newest version
package org.jetbrains.skia.skottie

import org.jetbrains.skia.impl.NativePointer
import org.jetbrains.skia.impl.interopScope
import org.jetbrains.skia.impl.withStringReferenceNullableResult
import org.jetbrains.skia.impl.withStringReferenceResult

internal actual fun Logger.doInit(ptr: NativePointer) {
    interopScope {
        val onLog = virtual {
            val level = LogLevel.values()[Logger_nGetLogLevel(ptr)]
            val message = withStringReferenceResult { Logger_nGetLogMessage(ptr) }
            val json = withStringReferenceNullableResult { Logger_nGetLogJson(ptr) }
            log(level, message, json)
        }
        Logger_nInit(ptr, onLog)
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy