From 66c5451293a7155931e6446d4f00d0dd9193e9fc Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Sun, 31 Jul 2022 19:22:08 +0600 Subject: [PATCH] now tag in MessageFormatter is a nullable --- src/commonMain/kotlin/KSLogTypealiases.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/commonMain/kotlin/KSLogTypealiases.kt b/src/commonMain/kotlin/KSLogTypealiases.kt index 1a8fb1d..0e2b5c8 100644 --- a/src/commonMain/kotlin/KSLogTypealiases.kt +++ b/src/commonMain/kotlin/KSLogTypealiases.kt @@ -1,8 +1,8 @@ package dev.inmo.kslog.common -typealias MessageFormatter = (l: LogLevel, t: String, m: Any, Throwable?) -> String +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" } +val defaultMessageFormatter: MessageFormatter = { l, t, m, _ -> "[$l] ${t ?.let { "$it " } ?: ""}- $m" }