Skip to content

Commit 53c437f

Browse files
committed
Allow overriding logging level
1 parent 85e5398 commit 53c437f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

main.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,11 @@ func printVersion() {
6464
func main() {
6565
var metricsAddr string
6666
flag.StringVar(&metricsAddr, "metrics-bind-address", "127.0.0.1:6000", "The address the metric endpoint binds to.")
67+
opts := zap.Options{}
68+
opts.BindFlags(flag.CommandLine)
6769
flag.Parse()
6870

69-
ctrl.SetLogger(zap.New(zap.UseDevMode(false)))
71+
ctrl.SetLogger(zap.New(zap.UseFlagOptions(&opts)))
7072

7173
namespaces, err := getWatchNamespace()
7274
if err != nil {

0 commit comments

Comments
 (0)