Open realdadfish opened 1 month ago
Also, on a related note, is there a way to synchronize / join on the pending / running coroutines? E.g. by remembering the started Job
instances from launch
es and join
on them? This is just a minor thing to stabilize my tests :)
You can configure all logging to be direct by setting minDirectLogLevel
. See Direct logging for details. It is not available on a per-logger or per-sink basis.
You can’t join a running coroutine from outside, as far as I know.
The prospect of having zero overhead logging is something I don't want to loose however. What if every log action is executed async and you provide a method to join on the last launched job(s) which one would have to call as last method in an UncaughtExceptionHandler
or just before System.exit()
?
So, the default configuration of klogging says that log levels higher than WARNINGs are logged immediately, whereas logging of INFO levels and below happens asynchronously. This will lead to the problem (obviously) that the log order cannot be guaranteed anymore, especially if the log output is directly processed log message after log message and not "cached, sorted and dumped" at some later time.
I'm not exactly sure how this can be handled properly by a custom
EventSender
, maybe through some kind of "flushing" signal?