Skip to content

Commit

Permalink
interceptors: Fix logrus example to iterate over all fields
Browse files Browse the repository at this point in the history
Fixes grpc-ecosystem#570

Signed-off-by: Chance Zibolski <[email protected]>
  • Loading branch information
chancez committed Jun 6, 2023
1 parent e4c2f09 commit c90d5cb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion interceptors/logging/examples/logrus/example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ func InterceptorLogger(l logrus.FieldLogger) logging.Logger {
return logging.LoggerFunc(func(_ context.Context, lvl logging.Level, msg string, fields ...any) {
f := make(map[string]any, len(fields)/2)
i := logging.Fields(fields).Iterator()
if i.Next() {
for i.Next() {
k, v := i.At()
f[k] = v
}
Expand Down

0 comments on commit c90d5cb

Please sign in to comment.