mirror of
https://github.com/InsanusMokrassar/KSLog.git
synced 2026-01-22 03:47:56 +00:00
a lot of changes and improvements
This commit is contained in:
19
src/jsMain/kotlin/KSLoggerDefaultPlatformLoggerLambda.kt
Normal file
19
src/jsMain/kotlin/KSLoggerDefaultPlatformLoggerLambda.kt
Normal file
@@ -0,0 +1,19 @@
|
||||
package dev.inmo.kslog.common
|
||||
|
||||
actual var KSLoggerDefaultPlatformLoggerLambda: (level: LogLevel, tag: String, message: Any, throwable: Throwable?) -> Unit = { l, _, m, e ->
|
||||
val args = e ?.let {
|
||||
arrayOf(m, e)
|
||||
} ?: arrayOf(m)
|
||||
when (l) {
|
||||
LogLevel.TRACE -> {
|
||||
console.trace()
|
||||
console.debug(*args)
|
||||
}
|
||||
LogLevel.DEBUG -> console.debug(*args)
|
||||
LogLevel.VERBOSE,
|
||||
LogLevel.INFO -> console.info(*args)
|
||||
LogLevel.WARNING -> console.warn(*args)
|
||||
LogLevel.ERROR -> console.error(*args)
|
||||
LogLevel.ASSERT -> console.assert(*args)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user