Add debug level to JS logger

This commit is contained in:
Alexander Nozik 2022-08-14 15:09:51 +03:00
parent f8eea45ed0
commit 70bd92f019
No known key found for this signature in database
GPG Key ID: F7FCF2DD25C71357

View File

@ -9,6 +9,8 @@ public class ConsoleLogManager : AbstractPlugin(), LogManager {
override fun logger(name: Name): Logger = Logger { tag, body -> override fun logger(name: Name): Logger = Logger { tag, body ->
val message: String = body.safe val message: String = body.safe
when (tag) { 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.INFO -> console.info("[${context.name}] $name: $message")
LogManager.WARNING -> console.warn("[${context.name}] $name: $message") LogManager.WARNING -> console.warn("[${context.name}] $name: $message")
LogManager.ERROR -> console.error("[${context.name}] $name: $message") LogManager.ERROR -> console.error("[${context.name}] $name: $message")