Open
Conversation
rootCmd.PersistentFlags().GetBool("verbose") always returned false prior
this commit because flags are not parse yet. This happens only when
rootCmd.Execute() is called.
Fix this by using one of the cobra hooks that runs after flags are
parsed. Note that the hook is needed because we want to enable verbose
logging for all subcommands. Otherwise, we would have to enable it in
every single subcommand.
I also added a small log message that actually informs users that
verbose logging is enabled.
osbuild/images still use logrus for some its logging, so let's enable it as well until we can fully migrate over.
1a7d336 to
c0a89cf
Compare
achilleas-k
approved these changes
Jan 29, 2026
lzap
requested changes
Jan 29, 2026
Contributor
lzap
left a comment
There was a problem hiding this comment.
The logrus dependency was pulled into images accidentally. I already cleaned it from logrus and created pkg/olog proxy that is supposed to do the job. I suggest that we do not merge this and I fix images instead.
Contributor
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.
2 commits meant for fixing, and improving the
--verbosemode. Turns out it didn't work at all before.main: fix --verbose logging
rootCmd.PersistentFlags().GetBool("verbose") always returned false prior
this commit because flags are not parse yet. This happens only when
rootCmd.Execute() is called.
Fix this by using one of the cobra hooks that runs after flags are
parsed. Note that the hook is needed because we want to enable verbose
logging for all subcommands. Otherwise, we would have to enable it in
every single subcommand.
I also added a small log message that actually informs users that
verbose logging is enabled.
main: enable logrus in --verbose mode
osbuild/images still use logrus for some its logging, so let's enable it
as well until we can fully migrate over.