-
Notifications
You must be signed in to change notification settings - Fork 748
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mock: document public API in collector module #2389
Conversation
There has been interest around publishing `tracing-mock` to crates.io for some time. In order to make this possible, documentation and some code clean up is needed. This change adds documentation to the collector module itself and to all the public APIs in the module. This includes doctests on all the methods that serve as examples. Additionally the implementation for the `Expect` struct has been moved into the module with the definition, this was missed in #2369. Refs: #539
It creates too many issues (need to add `allow_deprecated` annotations all over the place) and they will actually make fixing those tests to use the new (but as yet unimplemented) `MockCollector::close_span` more difficult.
They are! I removed the referce to `MockCollector::close_span` as it doesn't yet exist.
Also cleaned up the text and tried to apply the code review comments from #2426 to what I'd written already.
tracing-mock/src/collector.rs
Outdated
@@ -311,7 +313,7 @@ where | |||
/// | |||
/// [`Collect::drop_span`]: fn@tracing::Collect::drop_span | |||
/// [`close_span`]: fn@Self::close_span | |||
#[deprecated(since = "0.1.0", note = "use `MockCollector::close_span` instead")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why was the deprecated attribute on this function removed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding the deprecated attribute meant adding #[allow_deprecated]
on every single usage of it throughout the tracing tests. I felt it better to leave the deprecated attribute off until I can add a replacement. Then the current usage of drop_span
can be replaced and this method can be marked as deprecated.
Co-authored-by: Eliza Weisman <eliza@buoyant.io>
All based on the lovely code review feedback I've been receiving.
… into hds/mock-collector-docs
The PR documenting the subscriber module.
I'm not really gonna be able to review the documentation for this; I trust that Eliza has gotten most of this. |
There has been interest around publishing `tracing-mock` to crates.io for some time. In order to make this possible, documentation and some code clean up is needed. This change adds documentation to the collector module itself and to all the public APIs in the module. This includes doctests on all the methods that serve as examples. Additionally the implementation for the `Expect` struct has been moved into the module with the definition, this was missed in #2369. Refs: #539
There has been interest around publishing `tracing-mock` to crates.io for some time. In order to make this possible, documentation and some code clean up is needed. This change adds documentation to the collector module itself and to all the public APIs in the module. This includes doctests on all the methods that serve as examples. Additionally the implementation for the `Expect` struct has been moved into the module with the definition, this was missed in #2369. Refs: #539
There has been interest around publishing `tracing-mock` to crates.io for some time. In order to make this possible, documentation and some code clean up is needed. This change adds documentation to the collector module itself and to all the public APIs in the module. This includes doctests on all the methods that serve as examples. Additionally the implementation for the `Expect` struct has been moved into the module with the definition, this was missed in #2369. Refs: #539
There has been interest around publishing `tracing-mock` to crates.io for some time. In order to make this possible, documentation and some code clean up is needed. This change adds documentation to the collector module itself and to all the public APIs in the module. This includes doctests on all the methods that serve as examples. Additionally the implementation for the `Expect` struct has been moved into the module with the definition, this was missed in #2369. Refs: #539
There has been interest around publishing `tracing-mock` to crates.io for some time. In order to make this possible, documentation and some code clean up is needed. This change adds documentation to the collector module itself and to all the public APIs in the module. This includes doctests on all the methods that serve as examples. Additionally the implementation for the `Expect` struct has been moved into the module with the definition, this was missed in #2369. Refs: #539
There has been interest around publishing `tracing-mock` to crates.io for some time. In order to make this possible, documentation and some code clean up is needed. This change adds documentation to the collector module itself and to all the public APIs in the module. This includes doctests on all the methods that serve as examples. Additionally the implementation for the `Expect` struct has been moved into the module with the definition, this was missed in tokio-rs#2369. Refs: tokio-rs#539
Motivation
There has been interest around publishing
tracing-mock
to crates.iofor some time. In order to make this possible, documentation and some
code clean up is needed.
Solution
This change adds documentation to the collector module itself and to all the
public APIs in the module. This includes doctests on all the methods
that serve as examples.
Additionally the implementation for the
Expect
struct has been movedinto the module with the definition, this was missed in #2369.
Refs: #539