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

[v1.13] Make logging.InitializeDefaultLogger private #29700

Merged
merged 2 commits into from
Dec 8, 2023

Conversation

antonipp
Copy link
Contributor

@antonipp antonipp commented Dec 7, 2023

1.13 backport for #29495

As mentioned in #29495 (comment), the original PR contained code which relied on changes made in #26327 and #23971. I tried to workaround this as much as possible to make the backport as minimal and self-contained as possible:

Once this PR is merged, a GitHub action will update the labels of these PRs:

 29495

[ upstream commit: b175548 ]

The function InitializeDefaultLogger creates a new logger with the
default settings and returns it. This commit removes a call to this
function that doesn't save the return value, essentially calling it for
no reason.

Signed-off-by: Ryan Drew <ryan.drew@isovalent.com>
Signed-off-by: Anton Ippolitov <anton.ippolitov@datadoghq.com>
@antonipp antonipp requested a review from a team as a code owner December 7, 2023 14:39
@maintainer-s-little-helper maintainer-s-little-helper bot added backport/1.13 This PR represents a backport for Cilium 1.13.x of a PR that was merged to main. kind/backports This PR provides functionality previously merged into master. labels Dec 7, 2023
@github-actions github-actions bot added the kind/community-contribution This was a contribution made by a community member. label Dec 7, 2023
@antonipp
Copy link
Contributor Author

antonipp commented Dec 7, 2023

/test-backport-1.13

[ upstream commit 00ab252 ]

[ Backporter's notes: ignoring changes from cilium#26327 and cilium#23971 ]

The DefaultLogger variable in the logging module serves as a parent logger
which all other loggers can be derived from. It is initialized using the
InitializeDefaultLogger function and then adjusted on startup based on
user configuration. Users should not call InitializeDefaultLogger to
create a parent logger for their logger, since the logger returned by
InitializeDefaultLogger will always use the hardcoded defaults. For
example, the logger returned will always be of level INFO, even if a user
has enabled debug logging. To make this clear, this commit renames
InitializeDefaultLogger to initializeDefaultLogger to signal that it should
not be used outside of the logging module.

Fixes: cilium#29215

Signed-off-by: Ryan Drew <ryan.drew@isovalent.com>
Signed-off-by: Anton Ippolitov <anton.ippolitov@datadoghq.com>
@antonipp
Copy link
Contributor Author

antonipp commented Dec 7, 2023

I missed a small issue in the tests, going to re-run the suite again :(

@antonipp
Copy link
Contributor Author

antonipp commented Dec 7, 2023

/test-backport-1.13

@ti-mo ti-mo requested a review from learnitall December 7, 2023 16:19
Copy link
Contributor

@ti-mo ti-mo left a comment

Choose a reason for hiding this comment

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

I've requested a review from @learnitall to double check. I'll unblock the @cilium/tophat review.

Copy link
Contributor

@learnitall learnitall left a comment

Choose a reason for hiding this comment

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

Looks good, thank you!

@aanm
Copy link
Member

aanm commented Dec 8, 2023

/test-backport-1.13

@antonipp
Copy link
Contributor Author

antonipp commented Dec 8, 2023

The failing "Cilium IPsec upgrade" tests seem to be completely unrelated, looks like it's a known issue described here: #29351 (comment)

@maintainer-s-little-helper maintainer-s-little-helper bot added the ready-to-merge This PR has passed all tests and received consensus from code owners to merge. label Dec 8, 2023
@tklauser tklauser merged commit 739e9de into cilium:v1.13 Dec 8, 2023
61 of 62 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport/1.13 This PR represents a backport for Cilium 1.13.x of a PR that was merged to main. kind/backports This PR provides functionality previously merged into master. kind/community-contribution This was a contribution made by a community member. ready-to-merge This PR has passed all tests and received consensus from code owners to merge.
Projects
No open projects
Status: Released
Development

Successfully merging this pull request may close these issues.

None yet

5 participants