Skip to content

Commit e1cc430

Browse files
authored
core: handle max log level from CLI args (#88)
1 parent 4e2a877 commit e1cc430

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

cmd/digicert-issuer/main.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,12 @@ func main() {
6969
disableRootCA bool
7070
)
7171

72+
logOpts := zap.Options{
73+
Development: true,
74+
}
75+
76+
logOpts.BindFlags(flag.CommandLine)
77+
7278
flag.StringVar(&metricsAddr, "metrics-addr", ":8080",
7379
"The address the metric endpoint binds to.")
7480

@@ -97,7 +103,7 @@ func main() {
97103
os.Exit(0)
98104
}
99105

100-
ctrl.SetLogger(zap.New(zap.UseDevMode(true)))
106+
ctrl.SetLogger(zap.New(zap.UseFlagOptions(&logOpts)))
101107

102108
mgr, err := ctrl.NewManager(ctrl.GetConfigOrDie(), ctrl.Options{
103109
Cache: cache.Options{DefaultTransform: cache.TransformStripManagedFields()},

0 commit comments

Comments
 (0)