@@ -224,51 +224,10 @@ func InheritRequestLogger(ctx context.Context) (cleanup func()) {
224
224
return func () {}
225
225
}
226
226
227
- // Smart logging functions that can handle multiple signatures
228
- // These are the ONLY logging functions we need - they handle all cases
229
- func Info (msg string , args ... any ) {
230
- ctx , attrs := parseLogArgs (args ... )
231
- if ctx != nil {
232
- From (ctx ).Info (msg , attrs ... )
233
- } else if logger := getGoroutineLogger (); logger != nil {
234
- logger .Info (msg , attrs ... )
235
- } else {
236
- slog .Info (msg , attrs ... )
237
- }
238
- }
239
227
240
- func Error (msg string , args ... any ) {
241
- ctx , attrs := parseLogArgs (args ... )
242
- if ctx != nil {
243
- From (ctx ).Error (msg , attrs ... )
244
- } else if logger := getGoroutineLogger (); logger != nil {
245
- logger .Error (msg , attrs ... )
246
- } else {
247
- slog .Error (msg , attrs ... )
248
- }
249
- }
250
228
251
- func Debug (msg string , args ... any ) {
252
- ctx , attrs := parseLogArgs (args ... )
253
- if ctx != nil {
254
- From (ctx ).Debug (msg , attrs ... )
255
- } else if logger := getGoroutineLogger (); logger != nil {
256
- logger .Debug (msg , attrs ... )
257
- } else {
258
- slog .Debug (msg , attrs ... )
259
- }
260
- }
261
229
262
- func Warn (msg string , args ... any ) {
263
- ctx , attrs := parseLogArgs (args ... )
264
- if ctx != nil {
265
- From (ctx ).Warn (msg , attrs ... )
266
- } else if logger := getGoroutineLogger (); logger != nil {
267
- logger .Warn (msg , attrs ... )
268
- } else {
269
- slog .Warn (msg , attrs ... )
270
- }
271
- }
230
+
272
231
273
232
// parseLogArgs intelligently parses variadic arguments to extract context and attributes
274
233
func parseLogArgs (args ... any ) (context.Context , []any ) {
@@ -303,7 +262,3 @@ func parseLogArgs(args ...any) (context.Context, []any) {
303
262
return ctx , attrs
304
263
}
305
264
306
- // Backward compatibility functions (optional - can be removed if not needed)
307
- func InfoMsg (msg string , attrs ... any ) { slog .Default ().Info (msg , attrs ... ) }
308
- func ErrorMsg (msg string , attrs ... any ) { slog .Default ().Error (msg , attrs ... ) }
309
- func DebugMsg (msg string , attrs ... any ) { slog .Default ().Debug (msg , attrs ... ) }
0 commit comments