Allow setting `with_span_events` on the `tracing` `Layer`
I'd like to set .with_span_events(FmtSpan::NEW | FmtSpan::CLOSE) on the tracing Layer when running Cucumber, but there is no API for it. I have tried plenty of workarounds, but I always get duplicated, unordered or missing logs. Could you please provide an API for customizing your tracing Layer?
@RemiBardon could you elaborate more on this? It's hard for me to understand why .configure_and_init_tracing() doesn't solve your problem, given that you're free to do pretty much everything with the fmt_layer passed to the closure?
@tyranron fmt_layer is not a Layer, it's a Layered, which means it doesn't have the with_span_events function. Your library doesn't expose a way to access this function on the non-Layered Layer (which is what I need).
@RemiBardon actually, the struct Layered implements the Layer trait. However, you're referring to the fmt::Layer struct and its method, not the Layer trait. I see... and you want to access the initialized fmt::layer() directly to tweak it. Layered::downcast_ref() won't be much help here too, because the required methods have the self receiver, and we don't have Layered::downcast_mut() to mem::swap() it in any way too.
Ok. I will play with possible API extensions to support it and will ask your opinion on it. Thanks for making this clear!
@tyranron Oh yes sorry I was on my phone I tried to remember my previous explorations. Thank you for looking into it!