fix(iroh-blobs): preserve tracing subscriber in the LocalPool #2735
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This preserves the tracing subscriber that is installed in the current
thread when the LocalPool is created. It then installs it into every
thread managed by the pool, ensuring that tracing output from the pool
is preserved.
Breaking Changes
Why is this even pub? But fine:
iroh_blobs::util::local_pool::LocalPool
will now install the tracingsubscriber of the thread creating the pool, into each thread managed
by the pool. Practically this should not break any code already
managing their tracing subscribers either manually inside tasks or by
setting a global subscriber before creating the pool. But if you
really liked the behaviour of swallowing the logs on doing this it's a
breaking change.
Notes & open questions
Maybe this should be configurable, though since this is just an
internal tool for us I think we're fine just always having this
behaviour.
Fixes #2577
Replaces #2589
Change checklist