Open Mordil opened 1 year ago
Rather, we wanted to provide the LogCapture libs, like the one that distributed actors has implemented:
I forgot what that got stuck on, was it you @glbrntt or @fabianfett who was looking into this or am I misremembering?
We provided such for metrics, so we should do the same for log perhaps. For metrics it is: https://github.com/apple/swift-metrics-extras/tree/main/Sources/MetricsTestUtils which also was extracted from distributed actors cluster
gRPC does similar. I don't recall looking into making this a feature of swift-log though.
It would be great if we did have this though as it's a useful utility and annoying for folks to have to re-invent it each time they want it.
+1
Where are we at with this? Is this something that just needs a PR?
Just someone needs to do it, yes. If you're interested help here would be welcome.
It'd live in a LoggingTestKit the same as we do for metrics test kit. You can base the implementation on what the distributed cluster does.
Awesome. I'll look into creating a submission next week while I take extra time off for the US holiday weekend
This seems to have languished, so I put together this proposal: https://github.com/apple/swift-log/pull/316
If I get the thumbs up, then I'll put together a PR with that implementation. Please provide feedback in the above PR about the approach.
Thanks!
I have my own test helpers for validating logging behavior in my library
after writing tests for #243... the test helpers are much nicer than what I wrote.
It'd be nice if the helpers were made public in a
LoggingTestUtils
module to be imported in my test targets...