func UseSyncMapLevelCache(use bool) Option {
	return func(l *Logr) error {
		l.options.useSyncMapLevelCache = use
		return nil
	}
}
UseSyncMapLevelCache can be set to true when high concurrency (e.g. >32 cores)
is expected. This may improve performance with large numbers of cores - benchmark
for your use case.
package logr
import (
	"errors"
	"time"
)
type Option func(*Logr) error
type options struct {
	maxQueueSize            int
	onLoggerError           func(error)
	onQueueFull             func(rec *LogRec, maxQueueSize int) bool
	onTargetQueueFull       func(target Target, rec *LogRec, maxQueueSize int) bool
	onExit                  func(code int)
	onPanic                 func(err interface{})
	enqueueTimeout          time.Duration
	shutdownTimeout         time.Duration
	flushTimeout            time.Duration
	useSyncMapLevelCache    bool
	maxPooledBuffer         int
	disableBufferPool       bool
	metricsCollector        MetricsCollector
	metricsUpdateFreqMillis int64
	stackFilter             map[string]struct{}
}
func MaxQueueSize(size int) Option {
	return func(l *Logr) error {
		if size < 0 {
			return errors.New("size cannot be less than zero")
		}
		l.options.maxQueueSize = size
		return nil
	}
}
func OnLoggerError(f func(error)) Option {
	return func(l *Logr) error {
		l.options.onLoggerError = f
		return nil
	}
}
func OnQueueFull(f func(rec *LogRec, maxQueueSize int) bool) Option {
	return func(l *Logr) error {
		l.options.onQueueFull = f
		return nil
	}
}
func OnTargetQueueFull(f func(target Target, rec *LogRec, maxQueueSize int) bool) Option {
	return func(l *Logr) error {
		l.options.onTargetQueueFull = f
		return nil
	}
}
func OnExit(f func(code int)) Option {
	return func(l *Logr) error {
		l.options.onExit = f
		return nil
	}
}
func OnPanic(f func(err interface{})) Option {
	return func(l *Logr) error {
		l.options.onPanic = f
		return nil
	}
}
func EnqueueTimeout(dur time.Duration) Option {
	return func(l *Logr) error {
		l.options.enqueueTimeout = dur
		return nil
	}
}
func ShutdownTimeout(dur time.Duration) Option {
	return func(l *Logr) error {
		l.options.shutdownTimeout = dur
		return nil
	}
}
func FlushTimeout(dur time.Duration) Option {
	return func(l *Logr) error {
		l.options.flushTimeout = dur
		return nil
	}
}