Documentation
¶
Overview ¶
Package log implements the functions, types, and interfaces for the module.
Package log implements the functions, types, and interfaces for the module.
Package log implements the functions, types, and interfaces for the module.
Package log implements the functions, types, and interfaces for the module.
Index ¶
- Constants
- Variables
- func LevelOption(level string) slogx.Option
- func New(cfg *configv1.Logger) log.Logger
- func NewDiscard() log.Logger
- func NewKSLoggerWithOption(options []slogx.Option) *kslog.Logger
- func NewLevelSampler(logger log.Logger, sampling *LevelSampling) log.Logger
- type DiscardLogger
- func (d DiscardLogger) Debug(msg string, keyvals ...interface{})
- func (d DiscardLogger) Error(msg string, keyvals ...interface{})
- func (d DiscardLogger) Info(msg string, keyvals ...interface{})
- func (d DiscardLogger) Log(level log.Level, keyvals ...interface{}) error
- func (d DiscardLogger) Warn(msg string, keyvals ...interface{})
- type KFilter
- type KFilterOption
- type KHelper
- type KLevel
- type KLogger
- type KOption
- type KValuer
- type KWriterOptionFn
- type LevelSampler
- type LevelSampling
- type LoggerWithSampling
- type Sampler
Constants ¶
View Source
const ( LevelKey = log.LevelKey LevelDebug = log.LevelDebug LevelInfo = log.LevelInfo LevelWarn = log.LevelWarn LevelError = log.LevelError LevelFatal = log.LevelFatal )
Variables ¶
View Source
var ( DefaultLogger = log.DefaultLogger DefaultCaller = log.DefaultCaller DefaultTimestamp = log.DefaultTimestamp DefaultMessageKey = log.DefaultMessageKey )
View Source
var ( With = log.With WithContext = log.WithContext NewStdLogger = log.NewStdLogger ParseLevel = log.ParseLevel Value = log.Value Caller = log.Caller Timestamp = log.Timestamp FilterLevel = log.FilterLevel FilterKey = log.FilterKey FilterValue = log.FilterValue FilterFunc = log.FilterFunc NewFilter = log.NewFilter SetLogger = log.SetLogger GetLogger = log.GetLogger Log = log.Log Context = log.Context Debug = log.Debug Debugf = log.Debugf Debugw = log.Debugw Info = log.Info Infof = log.Infof Infow = log.Infow Warn = log.Warn Warnf = log.Warnf Warnw = log.Warnw Error = log.Error Errorf = log.Errorf Errorw = log.Errorw Fatal = log.Fatal Fatalf = log.Fatalf Fatalw = log.Fatalw WithMessageKey = log.WithMessageKey WithSprint = log.WithSprint WithSprintf = log.WithSprintf NewHelper = log.NewHelper WithWriterLevel = log.WithWriterLevel WithWriteMessageKey = log.WithWriteMessageKey NewWriter = log.NewWriter )
Functions ¶
func LevelOption ¶ added in v0.2.0
func NewDiscard ¶ added in v0.2.0
func NewKSLoggerWithOption ¶ added in v0.2.1
func NewLevelSampler ¶ added in v0.2.0
func NewLevelSampler(logger log.Logger, sampling *LevelSampling) log.Logger
Types ¶
type DiscardLogger ¶ added in v0.2.0
type DiscardLogger struct{}
func (DiscardLogger) Debug ¶ added in v0.2.0
func (d DiscardLogger) Debug(msg string, keyvals ...interface{})
func (DiscardLogger) Error ¶ added in v0.2.0
func (d DiscardLogger) Error(msg string, keyvals ...interface{})
func (DiscardLogger) Info ¶ added in v0.2.0
func (d DiscardLogger) Info(msg string, keyvals ...interface{})
func (DiscardLogger) Log ¶ added in v0.2.0
func (d DiscardLogger) Log(level log.Level, keyvals ...interface{}) error
func (DiscardLogger) Warn ¶ added in v0.2.0
func (d DiscardLogger) Warn(msg string, keyvals ...interface{})
type KFilterOption ¶ added in v0.1.18
type KFilterOption = log.FilterOption
type KWriterOptionFn ¶ added in v0.1.18
type KWriterOptionFn = log.WriterOptionFn
type LevelSampler ¶ added in v0.2.0
type LevelSampler struct {
// contains filtered or unexported fields
}
type LevelSampling ¶ added in v0.2.0
type LevelSampling struct {
// contains filtered or unexported fields
}
func NewLevelSampling ¶ added in v0.2.0
func NewLevelSampling(defaultRate float64) *LevelSampling
func (*LevelSampling) GetRate ¶ added in v0.2.0
func (ls *LevelSampling) GetRate(level log.Level) float64
func (*LevelSampling) ShouldSample ¶ added in v0.2.0
func (ls *LevelSampling) ShouldSample(level log.Level) bool
type LoggerWithSampling ¶ added in v0.2.0
type LoggerWithSampling struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.