Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewSetLoglevelHandler ¶
func NewSetLoglevelHandler(ctx context.Context, logLevelSetter LogLevelSetter) http.Handler
Types ¶
type LogLevelSetter ¶
func NewLogLevelSetter ¶
func NewLogLevelSetter( defaultLoglevel glog.Level, autoResetDuration time.Duration, ) LogLevelSetter
type LogLevelSetterFunc ¶
type Sampler ¶
type Sampler interface {
IsSample() bool
}
Sampler allow sample glog
sampler := NewSampleMod(10) if sampler.IsSample() { glog.V(2).Infof("banana") }
func NewSampleMod ¶
func NewSampleTime ¶
func NewSamplerGlogLevel ¶
func NewSamplerTrue ¶
func NewSamplerTrue() Sampler
type SamplerFactory ¶
type SamplerFactory interface {
Sampler() Sampler
}
SamplerFactory allow to inject sampler
var DefaultSamplerFactory SamplerFactory = SamplerFactoryFunc(func() Sampler { return SamplerList{ NewSampleTime(10 * time.Second), NewSamplerGlogLevel(4), } })
type SamplerFactoryFunc ¶
type SamplerFactoryFunc func() Sampler
func (SamplerFactoryFunc) Sampler ¶
func (s SamplerFactoryFunc) Sampler() Sampler
type SamplerFunc ¶
type SamplerFunc func() bool
func (SamplerFunc) IsSample ¶
func (s SamplerFunc) IsSample() bool
type SamplerList ¶
type SamplerList []Sampler
func (SamplerList) IsSample ¶
func (s SamplerList) IsSample() bool
Click to show internal directories.
Click to hide internal directories.