Skip to content

Commit

Permalink
mock: document public API in collector module (tokio-rs#2389)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
hds authored and kaffarell committed May 22, 2024
1 parent ae8b854 commit c64fedb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion tracing-mock/src/subscriber.rs
Original file line number Diff line number Diff line change
Expand Up @@ -768,7 +768,7 @@ impl MockSubscriberBuilder {
name: self.name,
current: Mutex::new(Vec::new()),
};
(collector, handle)
(subscriber, handle)
}
}

Expand Down
1 change: 1 addition & 0 deletions tracing-subscriber/tests/env_filter/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use tracing_mock::{collector, expect};
use tracing_subscriber::{
filter::{EnvFilter, LevelFilter},
prelude::*,
Registry,
};

#[test]
Expand Down

0 comments on commit c64fedb

Please sign in to comment.