mirror of
https://github.com/InsanusMokrassar/KSLog.git
synced 2025-09-15 21:19:27 +00:00
add defaultMessageFormatterWithErrorPrint
This commit is contained in:
@@ -2,6 +2,8 @@
|
||||
|
||||
## 0.5.1
|
||||
|
||||
* New property `defaultMessageFormatterWithErrorPrint` for messages format with errors
|
||||
|
||||
## 0.5.0
|
||||
|
||||
* `Kotlin`: `1.7.10`
|
||||
|
@@ -5,4 +5,4 @@ typealias MessageFormatter = (l: LogLevel, t: String?, m: Any, Throwable?) -> St
|
||||
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()}" } ?: ""}" }
|
||||
|
Reference in New Issue
Block a user