mirror of
https://github.com/InsanusMokrassar/KSLog.git
synced 2024-12-22 14:07:15 +00:00
isolate logging of KSLog'gers to avoid problems with parallel logs perform
This commit is contained in:
parent
3ff5d989b7
commit
34ea0bd91a
@ -4,6 +4,12 @@ import dev.inmo.kslog.common.CallbackKSLog
|
|||||||
import dev.inmo.kslog.common.KSLog
|
import dev.inmo.kslog.common.KSLog
|
||||||
|
|
||||||
infix operator fun KSLog.plus(other: KSLog) = CallbackKSLog { l, t, m, e ->
|
infix operator fun KSLog.plus(other: KSLog) = CallbackKSLog { l, t, m, e ->
|
||||||
this@plus.performLog(l, t, m, e)
|
val resultOfFirst = runCatching {
|
||||||
other.performLog(l, t, m, e)
|
this@plus.performLog(l, t, m, e)
|
||||||
|
}
|
||||||
|
val resultOfSecond = runCatching {
|
||||||
|
other.performLog(l, t, m, e)
|
||||||
|
}
|
||||||
|
resultOfFirst.onFailure { throw it }
|
||||||
|
resultOfSecond.onFailure { throw it }
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user