Skip to content

Commit 587ee80

Browse files
committed
pkg/tracing: LogrusHook.Fire: micro-optimisation
Check span.IsRecording first, as it's a more lightweight check than span.SpanContext().IsValid() Signed-off-by: Sebastiaan van Stijn <[email protected]>
1 parent ccf7938 commit 587ee80

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/tracing/log.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ func (h *LogrusHook) Fire(entry *log.Entry) error {
5959
return nil
6060
}
6161

62-
if !span.SpanContext().IsValid() || !span.IsRecording() {
62+
if !span.IsRecording() || !span.SpanContext().IsValid() {
6363
return nil
6464
}
6565

0 commit comments

Comments
 (0)