-
Notifications
You must be signed in to change notification settings - Fork 223
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
Logging improvements #941
Logging improvements #941
Conversation
AttrKeyError = "error" | ||
AttrKeyPeerID = "peer_id" | ||
AttrKeyKey = "key" | ||
AttrKeyCacheHit = "hit" | ||
AttrKeyInEvent = "in_event" | ||
AttrKeyOutEvent = "out_event" |
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.
If they are only used in the tele
package we could unexport them
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.
They're designed to be used wherever we need them, such as logging an attribute
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.
all good 👍
d.log.Warn(msg, tele.LogAttrError(err)) | ||
return | ||
} | ||
d.log.With(args...).Warn(msg, tele.LogAttrError(err)) |
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.
not necessary, but now that we have helper methods for logging error messages we could use the more performant LogAttrs method here. Error logs shouldn't live in the hot path anyway so feel free to ignore.
Makes the logging a little more consistent and adds debug logging for key routing events to help with testing during integration.