Skip to content

Commit

Permalink
Use zap.New instead of zap.Logger in ctrl.SetLogger
Browse files Browse the repository at this point in the history
  • Loading branch information
micnncim committed Oct 15, 2019
1 parent c0a784a commit d40b12f
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 6 deletions.
4 changes: 3 additions & 1 deletion designs/simplified-scaffolding.md
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,9 @@ func init() {
}

func main() {
ctrl.SetLogger(zap.Logger(true))
ctrl.SetLogger(zap.New(func(o *zap.Options) {
o.Development = true
}))

mgr, err := ctrl.NewManager(ctrl.GetConfigOrDie(), ctrl.Options{Scheme: scheme})
if err != nil {
Expand Down
4 changes: 3 additions & 1 deletion docs/book/src/cronjob-tutorial/testdata/emptymain.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,9 @@ func main() {
flag.StringVar(&metricsAddr, "metrics-addr", ":8080", "The address the metric endpoint binds to.")
flag.Parse()

ctrl.SetLogger(zap.Logger(true))
ctrl.SetLogger(zap.New(func(o *zap.Options) {
o.Development = true
}))

mgr, err := ctrl.NewManager(ctrl.GetConfigOrDie(), ctrl.Options{Scheme: scheme, MetricsBindAddress: metricsAddr})
if err != nil {
Expand Down
4 changes: 3 additions & 1 deletion docs/book/src/cronjob-tutorial/testdata/project/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,9 @@ func main() {
"Enable leader election for controller manager. Enabling this will ensure there is only one active controller manager.")
flag.Parse()

ctrl.SetLogger(zap.Logger(true))
ctrl.SetLogger(zap.New(func(o *zap.Options) {
o.Development = true
}))

mgr, err := ctrl.NewManager(ctrl.GetConfigOrDie(), ctrl.Options{
Scheme: scheme,
Expand Down
4 changes: 3 additions & 1 deletion docs/book/src/multiversion-tutorial/testdata/project/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,9 @@ func main() {
"Enable leader election for controller manager. Enabling this will ensure there is only one active controller manager.")
flag.Parse()

ctrl.SetLogger(zap.Logger(true))
ctrl.SetLogger(zap.New(func(o *zap.Options) {
o.Development = true
}))

mgr, err := ctrl.NewManager(ctrl.GetConfigOrDie(), ctrl.Options{
Scheme: scheme,
Expand Down
4 changes: 3 additions & 1 deletion pkg/scaffold/v2/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,9 @@ func main() {
"Enable leader election for controller manager. Enabling this will ensure there is only one active controller manager.")
flag.Parse()
ctrl.SetLogger(zap.Logger(true))
ctrl.SetLogger(zap.New(func(o *zap.Options) {
o.Development = true
}))
mgr, err := ctrl.NewManager(ctrl.GetConfigOrDie(), ctrl.Options{
Scheme: scheme,
Expand Down
4 changes: 3 additions & 1 deletion testdata/project-v2/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ func main() {
"Enable leader election for controller manager. Enabling this will ensure there is only one active controller manager.")
flag.Parse()

ctrl.SetLogger(zap.Logger(true))
ctrl.SetLogger(zap.New(func(o *zap.Options) {
o.Development = true
}))

mgr, err := ctrl.NewManager(ctrl.GetConfigOrDie(), ctrl.Options{
Scheme: scheme,
Expand Down

0 comments on commit d40b12f

Please sign in to comment.