mirror of
https://github.com/InsanusMokrassar/KSLog.git
synced 2025-10-27 17:40:07 +00:00
16 lines
444 B
Kotlin
16 lines
444 B
Kotlin
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 ->
|
|
val resultOfFirst = runCatching {
|
|
this@plus.performLog(l, t, m, e)
|
|
}
|
|
val resultOfSecond = runCatching {
|
|
other.performLog(l, t, m, e)
|
|
}
|
|
resultOfFirst.onFailure { throw it }
|
|
resultOfSecond.onFailure { throw it }
|
|
}
|