@@ -118,10 +118,6 @@ func From(ctx context.Context) *slog.Logger {
118
118
return slog .Default ()
119
119
}
120
120
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
- }
125
121
126
122
// Default returns the default logger for backward compatibility
127
123
func Default () * slog.Logger {
@@ -228,39 +224,3 @@ func InheritRequestLogger(ctx context.Context) (cleanup func()) {
228
224
229
225
230
226
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