Documentation ¶
Index ¶
- func Debugw(msg string, keysAndValues ...interface{})
- func Errorw(msg string, err error, keysAndValues ...interface{})
- func Infow(msg string, keysAndValues ...interface{})
- func InitFromConfig(conf Config, name string)
- func ParseZapLevel(level string) zapcore.Level
- func Proto(val proto.Message) zapcore.ObjectMarshaler
- func SetLogger(l Logger, name string)
- func Warnw(msg string, err error, keysAndValues ...interface{})
- type Config
- type LogRLogger
- func (l LogRLogger) Debugw(msg string, keysAndValues ...interface{})
- func (l LogRLogger) Errorw(msg string, err error, keysAndValues ...interface{})
- func (l LogRLogger) Infow(msg string, keysAndValues ...interface{})
- func (l LogRLogger) Warnw(msg string, err error, keysAndValues ...interface{})
- func (l LogRLogger) WithCallDepth(depth int) Logger
- func (l LogRLogger) WithItemSampler() Logger
- func (l LogRLogger) WithName(name string) Logger
- func (l LogRLogger) WithValues(keysAndValues ...interface{}) Logger
- func (l LogRLogger) WithoutSampler() Logger
- type Logger
- type ZapLogger
- func (l *ZapLogger) Debugw(msg string, keysAndValues ...interface{})
- func (l *ZapLogger) Errorw(msg string, err error, keysAndValues ...interface{})
- func (l *ZapLogger) Infow(msg string, keysAndValues ...interface{})
- func (l *ZapLogger) ToZap() *zap.SugaredLogger
- func (l *ZapLogger) Warnw(msg string, err error, keysAndValues ...interface{})
- func (l *ZapLogger) WithCallDepth(depth int) Logger
- func (l *ZapLogger) WithItemSampler() Logger
- func (l *ZapLogger) WithName(name string) Logger
- func (l *ZapLogger) WithValues(keysAndValues ...interface{}) Logger
- func (l *ZapLogger) WithoutSampler() Logger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitFromConfig ¶ added in v0.13.1
InitFromConfig initializes a Zap-based logger
func ParseZapLevel ¶ added in v0.13.1
Types ¶
type Config ¶ added in v0.13.1
type Config struct { JSON bool `yaml:"json"` Level string `yaml:"level"` // true to enable log sampling, where the same log message and level will be throttled. // we have two layers of sampling // 1. global sampling - within a second, it will log the first SampleInitial, then every SampleInterval messages. // 2. per participant/track sampling - to be used with Logger.WithItemSampler(). This would be used to throttle // the logs for a particular participant/track. Sample bool `yaml:"sample,omitempty"` // global sampling per server // when sampling, the first N logs will be logged SampleInitial int `yaml:"sample_initial,omitempty"` // when sampling, every Mth log will be logged SampleInterval int `yaml:"sample_interval,omitempty"` // participant/track level sampling ItemSampleSeconds int `yaml:"item_sample_seconds,omitempty"` ItemSampleInitial int `yaml:"item_sample_initial,omitempty"` ItemSampleInterval int `yaml:"item_sample_interval,omitempty"` }
type LogRLogger ¶ added in v1.3.0
func (LogRLogger) Debugw ¶ added in v1.3.0
func (l LogRLogger) Debugw(msg string, keysAndValues ...interface{})
func (LogRLogger) Errorw ¶ added in v1.3.0
func (l LogRLogger) Errorw(msg string, err error, keysAndValues ...interface{})
func (LogRLogger) Infow ¶ added in v1.3.0
func (l LogRLogger) Infow(msg string, keysAndValues ...interface{})
func (LogRLogger) Warnw ¶ added in v1.3.0
func (l LogRLogger) Warnw(msg string, err error, keysAndValues ...interface{})
func (LogRLogger) WithCallDepth ¶ added in v1.3.0
func (l LogRLogger) WithCallDepth(depth int) Logger
func (LogRLogger) WithItemSampler ¶ added in v1.3.0
func (l LogRLogger) WithItemSampler() Logger
func (LogRLogger) WithName ¶ added in v1.3.0
func (l LogRLogger) WithName(name string) Logger
func (LogRLogger) WithValues ¶ added in v1.3.0
func (l LogRLogger) WithValues(keysAndValues ...interface{}) Logger
func (LogRLogger) WithoutSampler ¶ added in v1.4.2
func (l LogRLogger) WithoutSampler() Logger
type Logger ¶ added in v0.10.0
type Logger interface { Debugw(msg string, keysAndValues ...interface{}) Infow(msg string, keysAndValues ...interface{}) Warnw(msg string, err error, keysAndValues ...interface{}) Errorw(msg string, err error, keysAndValues ...interface{}) WithValues(keysAndValues ...interface{}) Logger WithName(name string) Logger WithCallDepth(depth int) Logger WithItemSampler() Logger // WithoutSampler returns the original logger without sampling WithoutSampler() Logger }
type ZapLogger ¶ added in v1.3.0
type ZapLogger struct { SampleDuration time.Duration SampleInitial int SampleInterval int // contains filtered or unexported fields }
func NewZapLogger ¶ added in v1.3.0
func (*ZapLogger) ToZap ¶ added in v1.3.1
func (l *ZapLogger) ToZap() *zap.SugaredLogger
func (*ZapLogger) WithCallDepth ¶ added in v1.3.0
func (*ZapLogger) WithItemSampler ¶ added in v1.3.0
func (*ZapLogger) WithValues ¶ added in v1.3.0
func (*ZapLogger) WithoutSampler ¶ added in v1.4.2
Click to show internal directories.
Click to hide internal directories.