tokio-rs / tracing

Application level tracing for Rust.
https://tracing.rs
MIT License
5.19k stars 677 forks source link

docs: enable and clean up ignored doc tests #2896

Open mladedav opened 4 months ago

mladedav commented 4 months ago

Motivation

Some tests were ignored with a TODO to enable them.

The doc-test for Subscriber::record provides misleading code that does not compile.

Solution

I enabled the tests that can be enabled.

I fixed the usage of omitted fields in Subscriber::record docs, but since the example uses a macro from tracing, it cannot be enabled.

For some tests I added a check that a feature that is needed is present. All tests should now work either out of the box or with --all-features