sc-tracing: Only print events for whitelisted targets (#14487)

* 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 <koute@users.noreply.github.com>

* Fix

---------

Co-authored-by: Koute <koute@users.noreply.github.com>
This commit is contained in:
Bastian Köcher
2023-07-03 11:47:42 +02:00
committed by GitHub
parent 6005d19905
commit d124c90734
+4
View File
@@ -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())