Documentation ¶
Index ¶
- func SetLevel(level LogLevel)
- type DefaultLogger
- func (dl *DefaultLogger) Begin(ctx context.Context, f string)
- func (dl *DefaultLogger) Errorf(ctx context.Context, s string, args ...interface{})
- func (dl *DefaultLogger) Infof(ctx context.Context, s string, args ...interface{})
- func (dl *DefaultLogger) Warningf(ctx context.Context, s string, args ...interface{})
- type Klog
- func (kl *Klog) Begin(ctx context.Context, f string)
- func (kl *Klog) Errorf(ctx context.Context, s string, args ...interface{})
- func (kl *Klog) Infof(ctx context.Context, s string, args ...interface{})
- func (kl *Klog) SetLogLevel(level LogLevel)
- func (kl *Klog) Warningf(ctx context.Context, s string, args ...interface{})
- type LogLevel
- type Logger
- type Nolog
- func (l *Nolog) Begin(ctx context.Context, f string)
- func (l *Nolog) Errorf(ctx context.Context, s string, args ...interface{})
- func (l *Nolog) Infof(ctx context.Context, s string, args ...interface{})
- func (l *Nolog) SetLogLevel(ll LogLevel)
- func (l *Nolog) Warningf(ctx context.Context, s string, args ...interface{})
- type Zerolog
- func (l *Zerolog) Begin(ctx context.Context, f string)
- func (l *Zerolog) Errorf(ctx context.Context, s string, args ...interface{})
- func (l *Zerolog) Infof(ctx context.Context, s string, args ...interface{})
- func (l *Zerolog) SetLogLevel(ll LogLevel)
- func (l *Zerolog) Warningf(ctx context.Context, s string, args ...interface{})
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DefaultLogger ¶
type DefaultLogger struct {
// contains filtered or unexported fields
}
DefaultLogger is the logger used when no other is specified.
func NewDefaultLogger ¶
func NewDefaultLogger() *DefaultLogger
NewDefaultLogger creates the default logger with settings found in the process environment.
func (*DefaultLogger) Begin ¶
func (dl *DefaultLogger) Begin(ctx context.Context, f string)
Begin writes a default log at the begining of a function.
func (*DefaultLogger) Errorf ¶
func (dl *DefaultLogger) Errorf(ctx context.Context, s string, args ...interface{})
Errorf is used for errorf at info level.
type Klog ¶ added in v1.2.9
type Klog struct {
// contains filtered or unexported fields
}
func (*Klog) SetLogLevel ¶ added in v1.2.9
type Logger ¶
type Logger interface { Begin(ctx context.Context, f string) Infof(ctx context.Context, s string, args ...interface{}) Warningf(ctx context.Context, s string, args ...interface{}) Errorf(ctx context.Context, s string, args ...interface{}) SetLogLevel(level LogLevel) }
Logger defines all methods required by an logger.
func NewKlogLogger ¶ added in v1.2.9
NewKlog returns a new instance of a wrapper around klog. If printLogLevel is set to WARNING or ERROR the logger only prints only logs with the corresponding level or higher. If printLogLevel is set to NONE the logger prints no logs.
func NewNoLogger ¶ added in v1.2.9
NewKlog returns a new instance of a wrapper around klog. If printLogLevel is set to WARNING or ERROR the logger only prints only logs with the corresponding level or higher. If printLogLevel is set to NONE the logger prints no logs.
func NewZerologger ¶ added in v1.2.9
type Nolog ¶ added in v1.2.9
type Nolog struct{}
func (*Nolog) SetLogLevel ¶ added in v1.2.9
type Zerolog ¶ added in v1.2.9
type Zerolog struct {
// contains filtered or unexported fields
}