Skip to content
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 APIs in event module #2426

Merged
merged 11 commits into from
Jan 5, 2023
2 changes: 1 addition & 1 deletion tracing-mock/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ publish = false
[dependencies]
tracing = { path = "../tracing", version = "0.2" }
tracing-core = { path = "../tracing-core", version = "0.2", default-features = false }
tracing-subscriber = { path = "../tracing-subscriber", version = "0.3", default-features = false, optional = true }
tracing-subscriber = { path = "../tracing-subscriber", version = "0.3", default-features = false, features = ["registry"], optional = true }
tokio-test = { version = "0.4.2", optional = true }

# Fix minimal-versions; tokio-test fails with otherwise acceptable 0.1.0
Expand Down
8 changes: 8 additions & 0 deletions tracing-mock/src/collector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,14 @@ where
match self.expected.lock().unwrap().pop_front() {
None => {}
Some(Expect::Event(mut expected)) => {
#[cfg(feature = "tracing-subscriber")]
{
if !expected.scope_mut().is_empty() {
unimplemented!(
"Expected scope for events is not supported with `MockCollector`."
)
}
}
let get_parent_name = || {
let stack = self.current.lock().unwrap();
let spans = self.spans.lock().unwrap();
Expand Down
Loading