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

server: only log warning if grpcServer.Serve() returned an error. #2763

Merged
merged 1 commit into from
Jan 31, 2024

Conversation

saser
Copy link
Contributor

@saser saser commented Jan 31, 2024

Additionally change the Key to be the listener address, which is hopefully more useful than a difficult-to-decipher dump of the listener struct.

The previous behavior would result in log lines like the following, even if nothing went wrong:

time="2024-01-31T17:30:25Z" level=warning msg="accept failed" Error="<nil>" Key="&{0x140002e4000 {<nil> 0 0}}" Topic=grpc

With this change, the message is only logged if there was an error, and it will look like this:

time="2024-01-31T17:40:25Z" level=warning msg="accept failed" Error="lolol just testing" Key="127.0.0.1:59289" Topic=grpc

Additionally change the `Key` to be the listener address, which is hopefully
more useful than a difficult-to-decipher dump of the listener struct.

The previous behavior would result in log lines like the following, even if
nothing went wrong:
```
time="2024-01-31T17:30:25Z" level=warning msg="accept failed" Error="<nil>" Key="&{0x140002e4000 {<nil> 0 0}}" Topic=grpc
```
With this change, the message is only logged if there was an error, and it will look like this:
```
time="2024-01-31T17:40:25Z" level=warning msg="accept failed" Error="lolol just testing" Key="127.0.0.1:59289" Topic=grpc
```
@fujita fujita merged commit ce7e5d3 into osrg:master Jan 31, 2024
39 checks passed
@fujita
Copy link
Member

fujita commented Jan 31, 2024

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants