Skip to content

Commit ea10178

Browse files
chancezrahulkhairwar
authored andcommitted
Fix logrus interceptor (grpc-ecosystem#588)
* interceptors: Fix logrus example to iterate over all fields Fixes grpc-ecosystem#570 Signed-off-by: Chance Zibolski <[email protected]> * interceptors: Update zap InterceptorLogger to use Iterator properly The logic in the example is redundant with the logging.Fields Iterator Signed-off-by: Chance Zibolski <[email protected]> --------- Signed-off-by: Chance Zibolski <[email protected]>
1 parent e895693 commit ea10178

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

interceptors/logging/examples/logrus/example_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ func InterceptorLogger(l logrus.FieldLogger) logging.Logger {
1818
return logging.LoggerFunc(func(_ context.Context, lvl logging.Level, msg string, fields ...any) {
1919
f := make(map[string]any, len(fields)/2)
2020
i := logging.Fields(fields).Iterator()
21-
if i.Next() {
21+
for i.Next() {
2222
k, v := i.At()
2323
f[k] = v
2424
}

0 commit comments

Comments
 (0)