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

Consistent log/error capitalization #6673

Merged
merged 6 commits into from
Aug 23, 2023

Conversation

antgamdia
Copy link
Contributor

Description of the change

The log traces and the error messages have an inconsistent capitalization across the codebase; this PR is to fix it.
I have used some regexes like fmt.(New|Debug|Warn||Warning|Info|Error|Fatal|Panic)(f?)(S?)\(("|')\p{Ll}, connect\.\w+, fmt.(New|Debug|Warn||Warning|Info|Error|Fatal|Panic)(f?)(S?)\(("|')\p{Ll} to find any possible offending occurrence.

The rationale behind the transformation is:

  • fmt.errorf -> lowercase
    • exception: those errors using connect.... will be returned to the user, these ones remain capitalized (converted some existing ones which wasn't)
  • log.xxxx -> uppercase

Benefits

Consistent capitalization.

Possible drawbacks

Some tests might fail, but will fix them straight away.

Applicable issues

Additional information

The next step would be unifying the actual messages, but this is another yak to shave...

Signed-off-by: Antonio Gamez Diaz <[email protected]>
Signed-off-by: Antonio Gamez Diaz <[email protected]>
Signed-off-by: Antonio Gamez Diaz <[email protected]>
Signed-off-by: Antonio Gamez Diaz <[email protected]>
Signed-off-by: Antonio Gamez Diaz <[email protected]>

Conflicts:
	cmd/apprepository-controller/cmd/root.go
@netlify
Copy link

netlify bot commented Aug 22, 2023

Deploy Preview for kubeapps-dev canceled.

Built without sensitive environment variables

Name Link
🔨 Latest commit 1742510
🔍 Latest deploy log https://app.netlify.com/sites/kubeapps-dev/deploys/64e4a0c9ecff3f0008366df5

@antgamdia antgamdia force-pushed the 6672-consistent-log-error-case branch from adec462 to 0e7b927 Compare August 22, 2023 11:41
Signed-off-by: Antonio Gamez Diaz <[email protected]>
@antgamdia antgamdia force-pushed the 6672-consistent-log-error-case branch from 0e7b927 to 1742510 Compare August 22, 2023 11:49
Copy link
Contributor

@absoludity absoludity left a comment

Choose a reason for hiding this comment

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

Thanks Antonio.

@antgamdia antgamdia merged commit 4a7ab79 into vmware-tanzu:main Aug 23, 2023
@antgamdia antgamdia deleted the 6672-consistent-log-error-case branch August 23, 2023 03:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Normalize log/error capitalization
3 participants