mirror of
https://github.com/InsanusMokrassar/KSLog.git
synced 2024-06-18 07:45:23 +00:00
9 lines
575 B
Kotlin
9 lines
575 B
Kotlin
package dev.inmo.kslog.common
|
|
|
|
typealias MessageFormatter = (l: LogLevel, t: String?, m: Any, Throwable?) -> String
|
|
@Suppress("NOTHING_TO_INLINE")
|
|
inline fun MessageFormatter(noinline formatter: MessageFormatter) = formatter
|
|
typealias MessageFilter = (l: LogLevel, t: String?, Throwable?) -> Boolean
|
|
val defaultMessageFormatter: MessageFormatter = { l, t, m, _ -> "[$l] ${t ?.let { "$it " } ?: ""}- $m" }
|
|
val defaultMessageFormatterWithErrorPrint: MessageFormatter = { l, t, m, e -> "[$l] ${t ?.let { "$it " } ?: ""}- $m${e ?.let { ": ${it.stackTraceToString()}" } ?: ""}" }
|