Skip to content

Commit d977cdc

Browse files
committed
feat: allow debugging events
1 parent 49a2b51 commit d977cdc

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/Instrumentation/Laravel/tests/Integration/TestCase.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,20 @@ protected function printSpans(): void
222222
$span->getName(),
223223
json_encode($span->getAttributes()->toArray())
224224
);
225+
226+
// Print events
227+
$events = $span->getEvents();
228+
if (count($events) > 0) {
229+
echo " Events:\n";
230+
foreach ($events as $eventIndex => $event) {
231+
echo sprintf(
232+
" Event %d: %s (attributes: %s)\n",
233+
$eventIndex,
234+
$event->getName(),
235+
json_encode($event->getAttributes()->toArray())
236+
);
237+
}
238+
}
225239
}
226240
}
227241

0 commit comments

Comments
 (0)