Skip to content

Commit 0a88cf5

Browse files
committed
remove unusued
1 parent 6c0824d commit 0a88cf5

File tree

1 file changed

+0
-40
lines changed

1 file changed

+0
-40
lines changed

backend/logging/context_logger.go

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -118,10 +118,6 @@ func From(ctx context.Context) *slog.Logger {
118118
return slog.Default()
119119
}
120120

121-
// With returns a new ctx with additional attrs layered onto the existing logger.
122-
func With(ctx context.Context, attrs ...any) context.Context {
123-
return Inject(ctx, From(ctx).With(attrs...))
124-
}
125121

126122
// Default returns the default logger for backward compatibility
127123
func Default() *slog.Logger {
@@ -228,39 +224,3 @@ func InheritRequestLogger(ctx context.Context) (cleanup func()) {
228224

229225

230226

231-
232-
233-
234-
// parseLogArgs intelligently parses variadic arguments to extract context and attributes
235-
func parseLogArgs(args ...any) (context.Context, []any) {
236-
if len(args) == 0 {
237-
return nil, nil
238-
}
239-
240-
var ctx context.Context
241-
var attrs []any
242-
243-
// Check if last argument is context
244-
lastIdx := len(args) - 1
245-
if c, ok := args[lastIdx].(context.Context); ok {
246-
ctx = c
247-
args = args[:lastIdx] // Remove context from args
248-
}
249-
250-
// Process remaining arguments
251-
for _, arg := range args {
252-
switch v := arg.(type) {
253-
case map[string]any:
254-
// Convert map to slog attributes
255-
for key, value := range v {
256-
attrs = append(attrs, slog.Any(key, value))
257-
}
258-
default:
259-
// Pass through regular slog attributes (key-value pairs)
260-
attrs = append(attrs, arg)
261-
}
262-
}
263-
264-
return ctx, attrs
265-
}
266-

0 commit comments

Comments
 (0)