Skip to content

Commit

Permalink
fix panic when log level is not defined
Browse files Browse the repository at this point in the history
  • Loading branch information
mathnogueira committed Feb 14, 2024
1 parent 2d99c76 commit d41c349
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions agent/runner/runstrategy_dashboard.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ func (s *Runner) RunDashboardStrategy(ctx context.Context, cfg agentConfig.Confi
}

func (s *Runner) disableLogger() func() {
if s.loggerLevel == nil {
// logger is not active, so it's safe to do nothing
return func() {}
}

oldLevel := s.loggerLevel.Level()
s.loggerLevel.SetLevel(zap.PanicLevel)

Expand Down

0 comments on commit d41c349

Please sign in to comment.