setDefaultKSLog and KSLog#plus(KSLog)

This commit is contained in:
InsanusMokrassar 2022-07-31 19:06:57 +06:00
parent 35e3d02837
commit 0e01534562
3 changed files with 14 additions and 0 deletions

View File

@ -2,6 +2,9 @@
## 0.4.2 ## 0.4.2
* Add `setDefaultKSLog`
* Add `plus` operation for two `KSLog` instances to call them both on each log performing
## 0.4.1 ## 0.4.1
* Fixes in resolution ambiguity for functions with messages * Fixes in resolution ambiguity for functions with messages

View File

@ -110,3 +110,5 @@ fun KSLog(
).filtered { l, _, _ -> ).filtered { l, _, _ ->
minLoggingLevel.ordinal <= l.ordinal minLoggingLevel.ordinal <= l.ordinal
} }
fun setDefaultKSLog(newDefault: KSLog) { KSLog.default = newDefault }

View File

@ -0,0 +1,9 @@
package dev.inmo.kslog.common.utils
import dev.inmo.kslog.common.CallbackKSLog
import dev.inmo.kslog.common.KSLog
infix operator fun KSLog.plus(other: KSLog) = CallbackKSLog { l, t, m, e ->
this@plus.performLog(l, t, m, e)
other.performLog(l, t, m, e)
}