Update pkg/logger/logger.go

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Hein Puth (Warkanum)
2025-12-30 13:00:56 +02:00
committed by GitHub
parent 8adc386863
commit bc2fdc143b

View File

@@ -84,12 +84,15 @@ func extractContext(args ...interface{}) (context.Context, []interface{}) {
found := false
for _, arg := range args {
if c, ok := arg.(context.Context); ok && !found {
ctx = c
found = true
} else {
newArgs = append(newArgs, arg)
if c, ok := arg.(context.Context); ok {
if !found {
ctx = c
found = true
}
// Ignore any additional context.Context arguments after the first one.
continue
}
newArgs = append(newArgs, arg)
}
return ctx, newArgs
}