func SetMetricsCollector(collector MetricsCollector, updateFreqMillis int64) Option {
	return func(l *Logr) error {
		if collector == nil {
			return errors.New("collector cannot be nil")
		}
		if updateFreqMillis < 250 {
			return errors.New("updateFreqMillis cannot be less than 250")
		}
		l.options.metricsCollector = collector
		l.options.metricsUpdateFreqMillis = updateFreqMillis
		return nil
	}
}
SetMetricsCollector enables metrics collection by supplying a MetricsCollector.
The MetricsCollector provides counters and gauges that are updated by log targets.
`updateFreqMillis` determines how often polled metrics are updated. Defaults to 15000 (15 seconds)
and must be at least 250 so we don't peg the CPU.
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
	}
}
func UseSyncMapLevelCache(use bool) Option {
	return func(l *Logr) error {
		l.options.useSyncMapLevelCache = use
		return nil
	}
}
func MaxPooledBufferSize(size int) Option {
	return func(l *Logr) error {
		l.options.maxPooledBuffer = size
		return nil
	}
}
func DisableBufferPool(disable bool) Option {
	return func(l *Logr) error {
		l.options.disableBufferPool = disable
		return nil
	}
}