-
Notifications
You must be signed in to change notification settings - Fork 78
Open
Labels
enhancementImprovement of existing features or bugfixImprovement of existing features or bugfixk::apiRelated to API (application interface)Related to API (application interface)questionFurther information is requestedFurther information is requested
Milestone
Description
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
?
Metadata
Metadata
Assignees
Labels
enhancementImprovement of existing features or bugfixImprovement of existing features or bugfixk::apiRelated to API (application interface)Related to API (application interface)questionFurther information is requestedFurther information is requested
Type
Projects
Milestone
Relationships
Development
Select code repository
Activity
chore(tests): Improve logging in smoke tests
tyranron commentedon Jan 20, 2025
@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 thefmt_layer
passed to the closure?RemiBardon commentedon Jan 20, 2025
@tyranron
fmt_layer
is not aLayer
, it's aLayered
, which means it doesn't have thewith_span_events
function. Your library doesn't expose a way to access this function on the non-Layered
Layer
(which is what I need).tyranron commentedon Jan 20, 2025
@RemiBardon actually, the struct
Layered
implements theLayer
trait. However, you're referring to thefmt::Layer
struct and its method, not theLayer
trait. I see... and you want to access the initializedfmt::layer()
directly to tweak it.Layered::downcast_ref()
won't be much help here too, because the required methods have theself
receiver, and we don't haveLayered::downcast_mut()
tomem::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!
RemiBardon commentedon Jan 20, 2025
@tyranron Oh yes sorry I was on my phone I tried to remember my previous explorations. Thank you for looking into it!
fmt::Layer
better (#353) #356