go-grpc-middleware icon indicating copy to clipboard operation
go-grpc-middleware copied to clipboard

Interceptors not compatible with log/slog.Default()

Open simone-dimaulo-hs opened this issue 10 months ago • 1 comments

The current implementation is not compatible with the std library log/slog package https://github.com/grpc-ecosystem/go-grpc-middleware/blob/main/interceptors/logging/logging.go#L188-L196

The compiler error is

have Log(context.Context, slog.Level, string, ...any)
want Log(context.Context, logging.Level, string, ...any)

Go version used: any version from 1.21

What happened: It's not possible to inject the slog.Default() logger to the interceptor

What you expected to happen: I'd like to be able to use the std slog logger

Any plan to be compatible with slog/log ?

simone-dimaulo-hs avatar Dec 19 '24 16:12 simone-dimaulo-hs