Skip to content

chore: ensure logs consistency across Coder #8083

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

Merged
merged 6 commits into from
Jun 20, 2023
Merged

Conversation

mtojek
Copy link
Member

@mtojek mtojek commented Jun 19, 2023

Related: #6726

This PR extends the ruleguard rules with slog. Actually, we caught a few incorrect or vague log messages.

New rules:

  • Key: field uuid.UUID should have the key with _id suffix. Sample: job -> job_id
  • Key: field should be snakecase
  • Message: should start with lowercase and don't end with period
  • Message: should contain at least 16 chars so that DevOps can set alarming
  • Replace slog.F("err", err) with slog.Error

I'm fine with adding more rules if you have any ideas.

@mtojek mtojek requested review from mafredri and kylecarbs June 19, 2023 15:50
@mtojek mtojek marked this pull request as ready for review June 19, 2023 15:50
Copy link
Member

@mafredri mafredri left a comment

Choose a reason for hiding this comment

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

Minor suggestions, but all in all looks good 👍🏻

@mtojek mtojek merged commit b1d1b63 into main Jun 20, 2023
@mtojek mtojek deleted the 6726-ensure-log-consistency branch June 20, 2023 10:30
@github-actions github-actions bot locked and limited conversation to collaborators Jun 20, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants