Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
sc-tracing: Only print events for whitelisted targets (#14487)
Browse files Browse the repository at this point in the history
* sc-tracing: Only print events for whitelisted targets

We should only print events for whitelisted targets, otherwise we may run into some stack overflow
while printing the event.

* Update client/tracing/src/lib.rs

Co-authored-by: Koute <[email protected]>

* Fix

---------

Co-authored-by: Koute <[email protected]>
  • Loading branch information
bkchr and koute authored Jul 3, 2023
1 parent 54dec3d commit 26692ff
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions client/tracing/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,10 @@ where
}

fn on_event(&self, event: &Event<'_>, ctx: Context<S>) {
if !self.check_target(event.metadata().target(), &event.metadata().level()) {
return
}

let parent_id = event.parent().cloned().or_else(|| {
if event.is_contextual() {
ctx.lookup_current().map(|span| span.id())
Expand Down

0 comments on commit 26692ff

Please sign in to comment.