| Filename | Latest commit message | Latest commit date |
|---|---|---|
## Motivation
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.
The `expect` module, which contains constructor functions for many of
the other `tracing-mock` modules needs documentation and examples.
This change adds documentation to the `expect` module and all the public
APIs within it. This includes doctests on all the methods which serve as
examples.
## Solution
The lint for `missing_docs` has been enabled for the entire
`tracing-mock` crate! This has been done together with all the
other lints that are enabled on the other crates in this project.
The `event::msg("message")` constructor was removed, in favor of
requiring an explicit construction via
`expect::event().with_fields(expect::msg("message"))`. This is
appropriate to reduce the API surface that would need to be supported in
the future and also because the `event::msg` constructor could be
overridden by a subsequent usage of `with_fields`. The shorthand
`expect::message()` was renamed to `expect::msg` to make this
change less burdensome.
The `span::named("name")` constructor was removed, in favor of requiring
an explicit construction via `expect::span.with_name("name")`. The
latter isn't much longer and since #3097, a string with the name can
be passed directly everywhere that an `ExpectedSpan` is required.
This change also sets the `missing_docs` lint to warn for the entire
`tracing-mock` crate, making it ready to publish (once backported).
Refs: #539
|
||
| .. | ||
| support | ||
| collector.rs | ||
| enabled.rs | ||
| event.rs | ||
| filter_caching_is_lexically_scoped.rs | ||
| filters_are_not_reevaluated_for_the_same_span.rs | ||
| filters_are_reevaluated_for_different_call_sites.rs | ||
| filters_dont_leak.rs | ||
| future_send.rs | ||
| instrument.rs | ||
| macro_imports.rs | ||
| macros.rs | ||
| max_level_hint.rs | ||
| multiple_max_level_hints.rs | ||
| no_collector.rs | ||
| rebuild_interest_doesnt_deadlock.rs | ||
| register_callsite_doesnt_deadlock.rs | ||
| span.rs | ||