feat: Add cmdline flag for log level - #324
Closed
nantiferov wants to merge 1 commit into
Closed
Conversation
fixes: valkey-io#321 Signed-off-by: Nicolai Antiferov <nicolai.antiferov@bolt.eu>
nantiferov
force-pushed
the
feat--Add-cmdline-flag-for-log-level
branch
from
July 21, 2026 20:02
be146d2 to
a058640
Compare
5 tasks
Contributor
Author
|
Option already exists, details in #321 (comment) |
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 PR closes #321
Summary
PR adding new command line flag to configure log verbosity. Atm it's debug, which generates quite a lot of messages on every reconcile loop.
Features / Behaviour Changes
New
-log-leveloption.infoby default.Implementation
I added new variable and
flag.Funcfor log-level command line flag. It parses provided string value, validates it and assigns one ofzapcore.LevelEnableraccordingly.Had to move
flag.Parse()beforeopts := zap.Options{in order to get logLevel before assigning it inzap.Options{.I also added couple of empty lines before and after flags definition to make them visibly separated. Please let me know if it should be reverted.
Limitations
Current issue is that with log-level = warn|error operator doesn't show even starting message.
Testing
Local test shows that setting is passed to logger.
Checklist
Before submitting the PR make sure the following are checked:
pre-commit run --all-filesor hooks on commit)