From 70bd92f01996cbc20a92d33867ba60e97fee8d9e Mon Sep 17 00:00:00 2001 From: Alexander Nozik Date: Sun, 14 Aug 2022 15:09:51 +0300 Subject: [PATCH] Add debug level to JS logger --- .../jsMain/kotlin/space/kscience/dataforge/context/loggingJs.kt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dataforge-context/src/jsMain/kotlin/space/kscience/dataforge/context/loggingJs.kt b/dataforge-context/src/jsMain/kotlin/space/kscience/dataforge/context/loggingJs.kt index 21cc036a..65b74bfa 100644 --- a/dataforge-context/src/jsMain/kotlin/space/kscience/dataforge/context/loggingJs.kt +++ b/dataforge-context/src/jsMain/kotlin/space/kscience/dataforge/context/loggingJs.kt @@ -9,6 +9,8 @@ public class ConsoleLogManager : AbstractPlugin(), LogManager { override fun logger(name: Name): Logger = Logger { tag, body -> val message: String = body.safe when (tag) { + // TODO depends on https://youtrack.jetbrains.com/issue/KT-33595/ + LogManager.DEBUG -> console.asDynamic().debug("[${context.name}] $name: $message") LogManager.INFO -> console.info("[${context.name}] $name: $message") LogManager.WARNING -> console.warn("[${context.name}] $name: $message") LogManager.ERROR -> console.error("[${context.name}] $name: $message")