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

Standardize logs #1053

Merged
merged 6 commits into from
Feb 18, 2022
Merged

Standardize logs #1053

merged 6 commits into from
Feb 18, 2022

Conversation

kfcampbell
Copy link
Member

@kfcampbell kfcampbell commented Jan 31, 2022

Frequently while working with the project, I find the logs messy and unwieldy to work with. I end up having to wade through a lot of unrelated logs to find interesting information, and our log level practices are all over the place.

This PR represents my best effort to standardize on Dave Cheney's log levels best practices. It removes all log levels except for two: INFO and DEBUG, which is information intended for the user and the developer, respectively. I've kept INFO-level logs to things like auth logic and when we make state correction for external changes. DEBUG-level logs tend to describe tricky logic, such as GitHub webhook state migration and commit lookup. In many cases, I've removed them entirely. In particular, I've removed logs that tend to describe what the ensuing function does. Those may be trivially added back by the developer when necessary, and our function/variable naming is good enough in my opinion that the log statements don't need to be replaced by comments.

My hope is this makes the provider a bit cleaner and easier to work with.

@kfcampbell kfcampbell marked this pull request as ready for review January 31, 2022 05:28
@kfcampbell kfcampbell added this to the v4.21.0 milestone Jan 31, 2022
@kfcampbell kfcampbell requested a review from jcudit January 31, 2022 05:29
@kfcampbell kfcampbell merged commit 8f95672 into integrations:main Feb 18, 2022
@kfcampbell kfcampbell deleted the standardize-logs branch February 18, 2022 23:51
@kfcampbell kfcampbell removed this from the v4.21.0 milestone Mar 3, 2022
kfcampbell added a commit to kfcampbell/terraform-provider-github that referenced this pull request Jul 26, 2022
* First batch of changes

* Another batch of changes

* More changes, maybe fix build

* More log cleanup

* Final changes

* Fix one additional error message
kazaker pushed a commit to auto1-oss/terraform-provider-github that referenced this pull request Dec 28, 2022
* First batch of changes

* Another batch of changes

* More changes, maybe fix build

* More log cleanup

* Final changes

* Fix one additional error message
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