Skip to content
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

Merged
merged 1 commit into from
Dec 9, 2024
Merged

Conversation

rosstimothy
Copy link
Contributor

No description provided.

@rosstimothy rosstimothy force-pushed the tross/srv_transport_slog branch 2 times, most recently from 396c618 to 0bcef1a Compare December 9, 2024 14:22
@rosstimothy rosstimothy marked this pull request as ready for review December 9, 2024 15:58
@@ -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))
Copy link
Contributor

@smallinsky smallinsky Dec 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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)))

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better yet:

Suggested change
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))

Copy link
Contributor Author

@rosstimothy rosstimothy Dec 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

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.

@rosstimothy rosstimothy requested a review from zmb3 December 9, 2024 18:05
@rosstimothy rosstimothy force-pushed the tross/srv_transport_slog branch from 3f0c17f to 02fdcf2 Compare December 9, 2024 18:26
@public-teleport-github-review-bot public-teleport-github-review-bot bot removed the request for review from bl-nero December 9, 2024 18:32
@rosstimothy rosstimothy force-pushed the tross/srv_transport_slog branch from 02fdcf2 to dfc4e43 Compare December 9, 2024 19:15
@rosstimothy rosstimothy added the no-changelog Indicates that a PR does not require a changelog entry label Dec 9, 2024
@rosstimothy rosstimothy enabled auto-merge December 9, 2024 19:41
@rosstimothy rosstimothy added this pull request to the merge queue Dec 9, 2024
Merged via the queue into master with commit b698968 Dec 9, 2024
40 of 41 checks passed
@rosstimothy rosstimothy deleted the tross/srv_transport_slog branch December 9, 2024 20:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no-changelog Indicates that a PR does not require a changelog entry size/sm
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants