Skip to content

Commit

Permalink
Update native to conform to the new kotlin
Browse files Browse the repository at this point in the history
  • Loading branch information
AzimMuradov committed Dec 10, 2023
1 parent 3212aed commit 7c1e78e
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
@OptIn(ExperimentalForeignApi::class)

package io.github.oshai.kotlinlogging

import kotlinx.cinterop.ExperimentalForeignApi
import kotlinx.cinterop.ptr
import platform.darwin.OS_LOG_TYPE_DEBUG
import platform.darwin.OS_LOG_TYPE_DEFAULT
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package io.github.oshai.kotlinlogging

import kotlin.native.concurrent.AtomicReference
import kotlin.concurrent.AtomicReference

public object KotlinLoggingConfiguration {
public var subsystem: AtomicReference<String?> = AtomicReference(null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ package io.github.oshai.kotlinlogging.internal
import io.github.oshai.kotlinlogging.DarwinKLogger
import io.github.oshai.kotlinlogging.KLogger
import io.github.oshai.kotlinlogging.KotlinLoggingConfiguration
import kotlin.native.concurrent.AtomicReference
import platform.darwin.OS_LOG_DEFAULT
import platform.darwin.os_log_create
import kotlin.concurrent.AtomicReference

/** factory methods to obtain a [KLogger] */
internal actual object KLoggerFactory {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
@file:OptIn(ExperimentalForeignApi::class)

package io.github.oshai.kotlinlogging

import kotlinx.cinterop.ExperimentalForeignApi
import platform.posix.fprintf
import platform.posix.stderr

public object ConsoleOutputAppender : FormattingAppender() {
@OptIn(ExperimentalForeignApi::class)
override fun logFormattedMessage(loggingEvent: KLoggingEvent, formattedMessage: Any?) {
if (loggingEvent.level == Level.ERROR) {
fprintf(stderr, "$formattedMessage\n")
Expand Down

0 comments on commit 7c1e78e

Please sign in to comment.