-
Notifications
You must be signed in to change notification settings - Fork 857
Add new filter methods #1973
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
Add new filter methods #1973
Changes from 13 commits
e66104b
a12c96f
0510795
7b104a1
8f26227
e45da8f
e8f10d9
c3da622
b1aad56
9242b5d
ed10ba3
6371aa0
7d35fc5
a162473
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -579,7 +579,9 @@ where | |
|
|
||
| fn on_new_span(&self, attrs: &span::Attributes<'_>, id: &span::Id, cx: Context<'_, S>) { | ||
| self.did_enable(|| { | ||
| self.layer.on_new_span(attrs, id, cx.with_filter(self.id())); | ||
| let cx = cx.with_filter(self.id()); | ||
| self.filter.on_new_span(attrs, id, cx.clone()); | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I mostly guessed here: should the Also, I guessed that it might be more correct to first update the filters and then the layer, not sure if that can make a difference or of the filter should be called last.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
This is a good question. The difference is that calling
I don't think it actually makes a difference which order the methods are called in. The filter can only enable/disable things in its
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Good to know about the order though. Thanks for the explanations! |
||
| self.layer.on_new_span(attrs, id, cx); | ||
| }) | ||
| } | ||
|
|
||
|
|
@@ -610,19 +612,22 @@ where | |
|
|
||
| fn on_enter(&self, id: &span::Id, cx: Context<'_, S>) { | ||
| if let Some(cx) = cx.if_enabled_for(id, self.id()) { | ||
| self.layer.on_enter(id, cx) | ||
| self.filter.on_enter(id, cx.clone()); | ||
| self.layer.on_enter(id, cx); | ||
| } | ||
| } | ||
|
|
||
| fn on_exit(&self, id: &span::Id, cx: Context<'_, S>) { | ||
| if let Some(cx) = cx.if_enabled_for(id, self.id()) { | ||
| self.layer.on_exit(id, cx) | ||
| self.filter.on_enter(id, cx.clone()); | ||
| self.layer.on_exit(id, cx); | ||
| } | ||
| } | ||
|
|
||
| fn on_close(&self, id: span::Id, cx: Context<'_, S>) { | ||
| if let Some(cx) = cx.if_enabled_for(&id, self.id()) { | ||
| self.layer.on_close(id, cx) | ||
| self.filter.on_close(id.clone(), cx.clone()); | ||
| self.layer.on_close(id, cx); | ||
| } | ||
| } | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.