Description
Feature Request
Refactor tracing-subscriber::tests::support
and tracing-mock
so that some items currently defined as public in tracing-mock
can be made not-public (specifically pub(crate)
).
Crates
tracing-subscriber
tracing-mock
Motivation
While documenting tracing-mock
, I found a couple of things in the collector
module which are public, but don't need to be except that they're used in the module tracing-subscriber::tests::support
.
In the context of #539, this is potentially exposing parts of tracing-mock
that it would be better not to expose. For example the num collector::Expect
is currenlty public, leaving it this way would make adding new expectations a breaking change.
Proposal
Move everything needed by tracing-subscriber
tests (that uses potential tracing-mock
internals) into tracing-mock
itself and put it behind a feature flag.
Alternatives
Another solution would be to duplicate the required parts of tracing-mock
in the support
module - which I think is how it was set up before.
Or these public items could be reworked to ensure forward comaptibility, for example by adding #[non_exhaustive]
to the previously mentioned Expect
enum.