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 found := false
for _, arg := range args { for _, arg := range args {
if c, ok := arg.(context.Context); ok && !found { if c, ok := arg.(context.Context); ok {
ctx = c if !found {
found = true ctx = c
} else { found = true
newArgs = append(newArgs, arg) }
// Ignore any additional context.Context arguments after the first one.
continue
} }
newArgs = append(newArgs, arg)
} }
return ctx, newArgs return ctx, newArgs
} }