-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Convert lib/srv/transport to use slog #49914
Conversation
396c618
to
0bcef1a
Compare
@@ -262,7 +263,7 @@ func (s *Service) ProxySSH(stream transportv1pb.TransportService_ProxySSHServer) | |||
case *transportv1pb.ProxySSHRequest_Agent: | |||
agentStream.incomingC <- frame.Agent.Payload | |||
default: | |||
s.cfg.Logger.Errorf("received unexpected ssh frame: %T", frame) | |||
s.cfg.Logger.ErrorContext(ctx, "received unexpected ssh frame", "frame", reflect.TypeOf(frame)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s.cfg.Logger.ErrorContext(ctx, "received unexpected ssh frame", "frame", reflect.TypeOf(frame)) | |
s.cfg.Logger.ErrorContext(ctx, "received unexpected ssh frame", "frame", fmt.Sprintf("%T", frame))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better yet:
s.cfg.Logger.ErrorContext(ctx, "received unexpected ssh frame", "frame", reflect.TypeOf(frame)) | |
s.cfg.Logger.ErrorContext(ctx, "received unexpected ssh frame", "frame", logutil.TypeAttr(frame)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've also opened https://github.com/gravitational/teleport.e/pull/5655 and #49948 to convert every existing fmt/reflect call to use logutils.TypeAttr.
3f0c17f
to
02fdcf2
Compare
02fdcf2
to
dfc4e43
Compare
No description provided.