Skip to content

feat: Add cmdline flag for log level - #324

Closed
nantiferov wants to merge 1 commit into
valkey-io:mainfrom
nantiferov:feat--Add-cmdline-flag-for-log-level
Closed

feat: Add cmdline flag for log level#324
nantiferov wants to merge 1 commit into
valkey-io:mainfrom
nantiferov:feat--Add-cmdline-flag-for-log-level

Conversation

@nantiferov

Copy link
Copy Markdown
Contributor

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-level option. info by default.

Implementation

I added new variable and flag.Func for log-level command line flag. It parses provided string value, validates it and assigns one of zapcore.LevelEnabler accordingly.
Had to move flag.Parse() before opts := zap.Options{ in order to get logLevel before assigning it in zap.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:

  • This Pull Request is related to one issue.
  • Commit message explains what changed and why
  • Tests are added or updated.
  • Documentation files are updated.
  • I have run pre-commit locally (pre-commit run --all-files or hooks on commit)

fixes: valkey-io#321

Signed-off-by: Nicolai Antiferov <nicolai.antiferov@bolt.eu>
@nantiferov
nantiferov force-pushed the feat--Add-cmdline-flag-for-log-level branch from be146d2 to a058640 Compare July 21, 2026 20:02
@nantiferov

Copy link
Copy Markdown
Contributor Author

Option already exists, details in #321 (comment)

@nantiferov nantiferov closed this Jul 22, 2026
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.

[FEATURE]: Add flag for log level configuration

1 participant