Skip to content

Commit 8b42ae3

Browse files
committed
build fixes
1 parent a0f6ac4 commit 8b42ae3

3 files changed

Lines changed: 12 additions & 17 deletions

File tree

gradle.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ kotlin.mpp.androidSourceSetLayoutVersion=2
66
kotlin.mpp.applyDefaultHierarchyTemplate=false
77
# Allow inconsistent JVM targets: Kotlin targets 1.8 (for compatibility), but module-info.java requires 9+.
88
kotlin.jvm.target.validation.mode=warning
9+
kotlin.mpp.enableCInteropCommonization=true

src/darwinMain/kotlin/io/github/oshai/kotlinlogging/DarwinKLogger.kt

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ import platform.darwin.OS_LOG_TYPE_DEBUG
99
import platform.darwin.OS_LOG_TYPE_DEFAULT
1010
import platform.darwin.OS_LOG_TYPE_ERROR
1111
import platform.darwin.OS_LOG_TYPE_INFO
12-
import platform.darwin.__dso_handle
13-
import platform.darwin._os_log_internal
1412
import platform.darwin.os_log_t
1513
import platform.darwin.os_log_type_enabled
1614
import platform.darwin.os_log_type_t
@@ -22,18 +20,16 @@ public class DarwinKLogger(override val name: String, override val underlyingLog
2220
if (isLoggingEnabledFor(level, marker)) {
2321
KLoggingEventBuilder().apply(block).run {
2422
val message = DarwinFormatter.getFormattedMessage(this, marker)
25-
val formattedMessage = if (marker != null) {
26-
// Separating marker and message because OSLog doesn't have a way to pass marker as a separate argument
27-
// formatting manually to string for now
28-
marker.toString() + " " + message
29-
} else {
30-
message
31-
}
32-
kotlin_logging_os_log(
33-
underlyingLogger,
34-
level.toDarwinLevel(),
35-
formattedMessage,
36-
)
23+
val formattedMessage =
24+
if (marker != null) {
25+
// Separating marker and message because OSLog doesn't have a way to pass marker as a
26+
// separate argument
27+
// formatting manually to string for now
28+
"$marker $message"
29+
} else {
30+
message
31+
}
32+
kotlin_logging_os_log(underlyingLogger, level.toDarwinLevel(), formattedMessage)
3733
}
3834
}
3935
}
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
package io.github.oshai.kotlinlogging
22

3-
import platform.Foundation.NSUUID
43
import kotlin.test.Test
5-
import kotlin.test.assertTrue
4+
import platform.Foundation.NSUUID
65

76
class Issue588Test {
87
@Test
@@ -13,5 +12,4 @@ class Issue588Test {
1312
logger.info { "Test message execution $uuid" }
1413
logger.error { "Test error execution $uuid" }
1514
}
16-
}
1715
}

0 commit comments

Comments
 (0)