Skip to content

Commit

Permalink
Enable debug logging
Browse files Browse the repository at this point in the history
  • Loading branch information
Jordan Olshevski committed Jan 2, 2024
1 parent 8a648eb commit 4044ce9
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
9 changes: 8 additions & 1 deletion cmd/eno-controller/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (

"github.com/go-logr/zapr"
"go.uber.org/zap"
"go.uber.org/zap/zapcore"
ctrl "sigs.k8s.io/controller-runtime"

"github.com/Azure/eno/internal/controllers/synthesis"
Expand All @@ -28,14 +29,20 @@ func run() error {
var (
rolloutCooldown time.Duration
synthesisTimeout time.Duration
debugLogging bool
synconf = &synthesis.Config{}
)
flag.DurationVar(&synconf.Timeout, "synthesis-pod-timeout", time.Minute, "Maximum lifespan of synthesizer pods")
flag.DurationVar(&synthesisTimeout, "synthesis-timeout", time.Second*30, "Timeout when executing synthesizer binaries")
flag.DurationVar(&rolloutCooldown, "rollout-cooldown", time.Second*30, "Minimum period of time between each ensuing composition update after a synthesizer is updated")
flag.BoolVar(&debugLogging, "debug", true, "Enable debug logging")
flag.Parse()

zl, err := zap.NewProduction()
zapCfg := zap.NewProductionConfig()
if debugLogging {
zapCfg.Level = zap.NewAtomicLevelAt(zapcore.DebugLevel)
}
zl, err := zapCfg.Build()
if err != nil {
return err
}
Expand Down
9 changes: 8 additions & 1 deletion cmd/eno-reconciler/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (

"github.com/go-logr/zapr"
"go.uber.org/zap"
"go.uber.org/zap/zapcore"
ctrl "sigs.k8s.io/controller-runtime"

"github.com/Azure/eno/internal/controllers/reconciliation"
Expand All @@ -28,17 +29,23 @@ func run() error {
rediscoverWhenNotFound bool
writeBatchInterval time.Duration
discoveryMaxRPS float32
debugLogging bool

mgrOpts = &manager.Options{
Rest: ctrl.GetConfigOrDie(),
}
)
flag.BoolVar(&rediscoverWhenNotFound, "rediscover-when-not-found", true, "Invalidate discovery cache when any type is not found in the openapi spec. Set this to false on <= k8s 1.14")
flag.DurationVar(&writeBatchInterval, "write-batch-interval", time.Second*5, "The max throughput of composition status updates")
flag.BoolVar(&debugLogging, "debug", true, "Enable debug logging")
mgrOpts.Bind(flag.CommandLine)
flag.Parse()

zl, err := zap.NewProduction()
zapCfg := zap.NewProductionConfig()
if debugLogging {
zapCfg.Level = zap.NewAtomicLevelAt(zapcore.DebugLevel)
}
zl, err := zapCfg.Build()
if err != nil {
return err
}
Expand Down

0 comments on commit 4044ce9

Please sign in to comment.