mirror of
https://github.com/InsanusMokrassar/KSLog.git
synced 2024-09-27 21:06:11 +00:00
19 lines
623 B
Kotlin
19 lines
623 B
Kotlin
|
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)
|
||
|
}
|
||
|
}
|