Skip to content

support setting a logger programatically #134

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 3 commits into from
Jul 17, 2025
Merged

support setting a logger programatically #134

merged 3 commits into from
Jul 17, 2025

Conversation

vroldanbet
Copy link
Contributor

@vroldanbet vroldanbet commented Jul 17, 2025

Make it possible to set a logger programmatically

Caveat: this does not help with klog verbosity, which still uses whatever default the flag parsing is set to.

@vroldanbet vroldanbet marked this pull request as ready for review July 17, 2025 17:47
@vroldanbet vroldanbet changed the title Improve logging support setting a logger programatically Jul 17, 2025
@ecordell
Copy link
Collaborator

I've used this in tests before:

	if verbosity := flag.CommandLine.Lookup("v"); verbosity.Value.String() == "" {
		Expect(verbosity.Value.Set("4")).To(Succeed())
	}

which mighk work to allow setting the verbosity programatically?

@vroldanbet
Copy link
Contributor Author

which mighk work to allow setting the verbosity programatically?

I can look into it, mind if we do in a follow up?

@vroldanbet vroldanbet merged commit fb51749 into main Jul 17, 2025
6 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Jul 17, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants