MessageFormatter factory

This commit is contained in:
InsanusMokrassar committed 2022-07-31 19:19:17 +06:00
1 parent 194e52f521
commit 77ca9ce25b
2 files changed
+3

No files matched your search

@@ -1,6 +1,8 @@
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 - $m" }