Documentation ¶
Index ¶
- Variables
- func Debug(a ...any)
- func Debugf(format string, a ...interface{})
- func Debugw(keyvals ...interface{})
- func Error(a ...interface{})
- func Errorf(format string, a ...interface{})
- func Errorw(keyvals ...interface{})
- func Fatal(a ...interface{})
- func Fatalf(format string, a ...interface{})
- func Fatalw(keyvals ...interface{})
- func Info(a ...interface{})
- func Infof(format string, a ...interface{})
- func Infow(keyvals ...interface{})
- func Log(level Level, keyvals ...any)
- func NewWriter(logger Logger, opts ...WriterOptionFn) io.Writer
- func SetLogger(logger Logger)
- func Value(ctx context.Context, v any) any
- func Warn(a ...interface{})
- func Warnf(format string, a ...interface{})
- func Warnw(keyvals ...interface{})
- type Filter
- type FilterOption
- type Helper
- func (h *Helper) Debug(a ...any)
- func (h *Helper) Debugf(format string, a ...any)
- func (h *Helper) Debugw(keyvals ...any)
- func (h *Helper) Error(a ...interface{})
- func (h *Helper) Errorf(format string, a ...interface{})
- func (h *Helper) Errorw(keyvals ...interface{})
- func (h *Helper) Fatal(a ...interface{})
- func (h *Helper) Fatalf(format string, a ...interface{})
- func (h *Helper) Fatalw(keyvals ...interface{})
- func (h *Helper) Info(a ...any)
- func (h *Helper) Infos(format string, a ...any)
- func (h *Helper) Infow(keyvals ...interface{})
- func (h *Helper) Log(level Level, keyvals ...any)
- func (h *Helper) Warn(a ...interface{})
- func (h *Helper) Warnf(format string, a ...interface{})
- func (h *Helper) Warnw(keyvals ...interface{})
- func (h *Helper) WithContext(ctx context.Context) *Helper
- type Level
- type Logger
- type Option
- type Valuer
- type WriterOptionFn
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultLogger = NewStdLogger(log.Writer())
View Source
var DefaultMessageKey = "msg"
DefaultMessageKey default message key.
Functions ¶
Types ¶
type Filter ¶
type Filter struct {
// contains filtered or unexported fields
}
func NewFilter ¶
func NewFilter(logger Logger, opts ...FilterOption) *Filter
type FilterOption ¶
type FilterOption func(*Filter)
func FilterFunc ¶
func FilterFunc(f func(level Level, keyvals ...any) bool) FilterOption
func FilterKey ¶
func FilterKey(key ...any) FilterOption
func FilterLevel ¶
func FilterLevel(level Level) FilterOption
func FilterValue ¶
func FilterValue(value ...any) FilterOption
type Helper ¶
type Helper struct {
// contains filtered or unexported fields
}
func (*Helper) Error ¶
func (h *Helper) Error(a ...interface{})
Error logs a message at error level.
func (*Helper) Errorw ¶
func (h *Helper) Errorw(keyvals ...interface{})
Errorw logs a message at error level.
func (*Helper) Fatal ¶
func (h *Helper) Fatal(a ...interface{})
Fatal logs a message at fatal level.
func (*Helper) Fatalw ¶
func (h *Helper) Fatalw(keyvals ...interface{})
Fatalw logs a message at fatal level.
func (*Helper) Infow ¶
func (h *Helper) Infow(keyvals ...interface{})
Infow logs a message at info level.
type Logger ¶
func NewStdLogger ¶
type WriterOptionFn ¶
type WriterOptionFn func(w *writerWrapper)
func WithWriterLevel ¶
func WithWriterLevel(level Level) WriterOptionFn
func WithWriterMessageKey ¶
func WithWriterMessageKey(key string) WriterOptionFn
Click to show internal directories.
Click to hide internal directories.