Skip to content

Commit

Permalink
Merge pull request #3384 from frebib/bug/verbosity
Browse files Browse the repository at this point in the history
Go 1.21 compatibility: Set verbosity after flag definition
  • Loading branch information
iwankgb authored Oct 7, 2023
2 parents 28d5bdd + 20317bf commit 4c67f45
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions cmd/cadvisor.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,14 +100,13 @@ func init() {
optstr := container.AllMetrics.String()
flag.Var(&ignoreMetrics, "disable_metrics", fmt.Sprintf("comma-separated list of `metrics` to be disabled. Options are %s.", optstr))
flag.Var(&enableMetrics, "enable_metrics", fmt.Sprintf("comma-separated list of `metrics` to be enabled. If set, overrides 'disable_metrics'. Options are %s.", optstr))

// Default logging verbosity to V(2)
_ = flag.Set("v", "2")
}

func main() {
klog.InitFlags(nil)
defer klog.Flush()
// Default logging verbosity to V(2)
_ = flag.Set("v", "2")
flag.Parse()

if *versionFlag {
Expand Down

0 comments on commit 4c67f45

Please sign in to comment.