Skip to content

Commit a0790e0

Browse files
Disable sampling for debug levels
1 parent 78ea3b6 commit a0790e0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pkg/log/zap/zap.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,8 @@ func (o *Options) addDefaults() {
181181
lvl := zap.NewAtomicLevelAt(zap.ErrorLevel)
182182
o.StacktraceLevel = &lvl
183183
}
184-
// Turn off sampling for all debug levels.
184+
// Disable sampling when we are in debug mode. Otherwise, this will
185+
// cause index out of bounds errors in the sampling code.
185186
if o.Level.Enabled(zapcore.DebugLevel) {
186187
o.ZapOpts = append(o.ZapOpts, zap.Development())
187188
} else {

0 commit comments

Comments
 (0)