Revert "log: define G() as a function instead of a variable"#9031
Merged
dmcgowan merged 1 commit intocontainerd:mainfrom Aug 31, 2023
Merged
Revert "log: define G() as a function instead of a variable"#9031dmcgowan merged 1 commit intocontainerd:mainfrom
dmcgowan merged 1 commit intocontainerd:mainfrom
Conversation
neersighted
approved these changes
Aug 30, 2023
This comment was marked as resolved.
This comment was marked as resolved.
This reverts commit 778ac30. (slightly modified, due to changes that were merged after that). The reverted commit had two elements; - Make `G` an actual function to improve the documentation - Prevent `G` from being overwritten externally From the commit that's reverted: > The `G` variable is exported, and not expected to be overwritten > externally. Defining it as a function also documents it as a function > on https://pkg.go.dev, instead of a variable; https://pkg.go.dev/github.com/containerd/[email protected]/log#pkg-variables While it's unclear if the ability to replace the implementation was _intentional_, it's this part that some external consumers were (ab)using. We should look into that part in a follow-up, and design for this, for example by providing a utility to replace the logger, and properly document that. In the meantime, let's revert the change. Signed-off-by: Sebastiaan van Stijn <[email protected]>
b9e74a7 to
19d6c37
Compare
neersighted
approved these changes
Aug 30, 2023
Contributor
neersighted
left a comment
There was a problem hiding this comment.
Tested and fixes BuildKit 0.12 with containerd 1.7 at moby/moby#45966.
dmcgowan
approved these changes
Aug 30, 2023
dcantah
approved these changes
Aug 31, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This reverts commit 778ac30.
(slightly modified, due to changes that were merged after that).
The reverted commit had two elements;
Gan actual function to improve the documentationGfrom being overwritten externallyFrom the commit that's reverted:
While it's unclear if the ability to replace the implementation was intentional, it's this part that some external consumers were (ab)using.
We should look into that part in a follow-up, and design for this, for example by providing a utility to replace the logger, and properly document that.
In the meantime, let's revert the change.