diff --git a/CHANGELOG.md b/CHANGELOG.md index 9978448..2062367 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ * Add `setDefaultKSLog` and `addDefaultKSLog` * Add `plus` operation for two `KSLog` instances to call them both on each log performing * Add `KSLog` factory for simple creation of `CallbackKSLog` +* Add `MessageFormatter` factory ## 0.4.1 diff --git a/src/commonMain/kotlin/KSLogTypealiases.kt b/src/commonMain/kotlin/KSLogTypealiases.kt index d36b5a1..1a8fb1d 100644 --- a/src/commonMain/kotlin/KSLogTypealiases.kt +++ b/src/commonMain/kotlin/KSLogTypealiases.kt @@ -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" }