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

chore(observability): Prefer using Display for logging errors #6389

Merged
merged 2 commits into from
Feb 9, 2021

Conversation

jszwedko
Copy link
Member

@jszwedko jszwedko commented Feb 8, 2021

The CONTRIBUTING guide accidentally had an example of using Debug, but
we'd decided to prefer Display for errors.

Fixes #6380

Signed-off-by: Jesse Szwedko jesse@szwedko.me

The CONTRIBUTING guide accidentally had an example of using Debug, but
we'd decided to prefer Display for errors.

Fixes #6380

Signed-off-by: Jesse Szwedko <jesse@szwedko.me>
@jszwedko jszwedko requested review from pablosichert, a team, zsherman, lukesteensen and eeyun and removed request for a team February 8, 2021 13:44
Signed-off-by: Jesse Szwedko <jesse@szwedko.me>
Copy link
Contributor

@fanatid fanatid left a comment

Choose a reason for hiding this comment

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

👍

@jamtur01 jamtur01 requested review from jamtur01 and removed request for jamtur01 February 8, 2021 15:07
@pablosichert
Copy link
Contributor

pablosichert commented Feb 8, 2021

There's a lot more occurrences if you search for = ? and , ?. However I'm not sure if they need to be adjusted for values that are not an error?

Copy link
Member

@lukesteensen lukesteensen left a comment

Choose a reason for hiding this comment

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

Makes sense! Agree with preferring Display in general, though there may be some cases where Debug works fine. We should just try to avoid any that are inconsistent with our formatting or otherwise too development-focused (as opposed to vector-user focused).

@jszwedko
Copy link
Member Author

jszwedko commented Feb 9, 2021

@pablosichert

There's a lot more occurrences if you search for = ? and , ?. However I'm not sure if they need to be adjusted for values that are not an error?

I'll merge this PR since this since it is an improvement, but I agree, we should think about where it makes sense to use % in more places. I also agree with Luke that debug might be fine in some circumstances so long as it outputs something useful to users.

@jszwedko jszwedko merged commit b2481db into master Feb 9, 2021
@jszwedko jszwedko deleted the prefer-display-error branch February 9, 2021 18:49
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.

Use Display consistently when emitting events
4 participants