From fc3db88a6cea39cd97e4b0dd2f0c1460cad433bf Mon Sep 17 00:00:00 2001 From: TheSaminator Date: Fri, 3 Jun 2022 18:39:42 -0400 Subject: [PATCH] Change logging --- src/commonMain/kotlin/starshipfights/game/ai/util.kt | 1 + src/jsMain/kotlin/starshipfights/game/ai/util_js.kt | 6 +++++- src/jvmMain/kotlin/starshipfights/game/ai/util_jvm.kt | 4 ++++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/commonMain/kotlin/starshipfights/game/ai/util.kt b/src/commonMain/kotlin/starshipfights/game/ai/util.kt index 3f3d42c..07cd069 100644 --- a/src/commonMain/kotlin/starshipfights/game/ai/util.kt +++ b/src/commonMain/kotlin/starshipfights/game/ai/util.kt @@ -9,6 +9,7 @@ import kotlin.math.pow import kotlin.math.sign import kotlin.random.Random +expect fun logDebug(message: Any?) expect fun logInfo(message: Any?) expect fun logWarning(message: Any?) expect fun logError(message: Any?) diff --git a/src/jsMain/kotlin/starshipfights/game/ai/util_js.kt b/src/jsMain/kotlin/starshipfights/game/ai/util_js.kt index b755861..be36797 100644 --- a/src/jsMain/kotlin/starshipfights/game/ai/util_js.kt +++ b/src/jsMain/kotlin/starshipfights/game/ai/util_js.kt @@ -1,9 +1,13 @@ package starshipfights.game.ai -actual fun logInfo(message: Any?) { +actual fun logDebug(message: Any?) { console.log(message) } +actual fun logInfo(message: Any?) { + console.info(message) +} + actual fun logWarning(message: Any?) { console.warn(message) } diff --git a/src/jvmMain/kotlin/starshipfights/game/ai/util_jvm.kt b/src/jvmMain/kotlin/starshipfights/game/ai/util_jvm.kt index 7a3df6c..300acc1 100644 --- a/src/jvmMain/kotlin/starshipfights/game/ai/util_jvm.kt +++ b/src/jvmMain/kotlin/starshipfights/game/ai/util_jvm.kt @@ -5,6 +5,10 @@ import org.slf4j.LoggerFactory val aiLogger: Logger = LoggerFactory.getLogger("SF_AI") +actual fun logDebug(message: Any?) { + aiLogger.debug(message.toString()) +} + actual fun logInfo(message: Any?) { aiLogger.info(message.toString()) } -- 2.25.1