logger

package
v4.52.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 21, 2023 License: MIT Imports: 10 Imported by: 31

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Close

func Close()

func Debug

func Debug(format string, a ...any)

func Error

func Error(format string, a ...any)

func Fatal

func Fatal(err error)

func Global

func Global(l Logger)

func Info

func Info(format string, a ...any)

func Trace

func Trace(format string, a ...any)

func Warn

func Warn(format string, a ...any)

func WriteEscapedJSON added in v4.22.4

func WriteEscapedJSON(content string, output *bytes.Buffer)

Types

type Config

type Config struct {
	// contains filtered or unexported fields
}

func Flags

func Flags(fs *flag.FlagSet, prefix string, overrides ...flags.Override) Config

type FieldsContext added in v4.7.0

type FieldsContext struct {
	// contains filtered or unexported fields
}

func (FieldsContext) Debug added in v4.7.0

func (f FieldsContext) Debug(format string, a ...any)

func (FieldsContext) Error added in v4.7.0

func (f FieldsContext) Error(format string, a ...any)

func (FieldsContext) Fatal added in v4.7.0

func (f FieldsContext) Fatal(err error)

func (FieldsContext) Info added in v4.7.0

func (f FieldsContext) Info(format string, a ...any)

func (FieldsContext) Trace added in v4.7.0

func (f FieldsContext) Trace(format string, a ...any)

func (FieldsContext) Warn added in v4.7.0

func (f FieldsContext) Warn(format string, a ...any)

func (FieldsContext) WithField added in v4.7.0

func (f FieldsContext) WithField(name string, value any) Provider

type GetNow added in v4.51.2

type GetNow func() time.Time

type Logger

type Logger struct {
	// contains filtered or unexported fields
}

func GetGlobal added in v4.37.0

func GetGlobal() Logger

func New

func New(config Config) Logger

func (Logger) Close

func (l Logger) Close()

func (Logger) Debug

func (l Logger) Debug(format string, a ...any)

func (Logger) Debugf added in v4.20.0

func (l Logger) Debugf(format string, a ...any)

func (Logger) Error

func (l Logger) Error(format string, a ...any)

func (Logger) Errorf added in v4.20.0

func (l Logger) Errorf(format string, a ...any)

func (Logger) Fatal

func (l Logger) Fatal(err error)

func (Logger) Info

func (l Logger) Info(format string, a ...any)

func (Logger) Infof added in v4.20.0

func (l Logger) Infof(format string, a ...any)

func (Logger) Start

func (l Logger) Start()

func (Logger) Trace

func (l Logger) Trace(format string, a ...any)

func (Logger) Warn

func (l Logger) Warn(format string, a ...any)

func (Logger) Warningf added in v4.20.0

func (l Logger) Warningf(format string, a ...any)

func (Logger) WithField added in v4.7.0

func (l Logger) WithField(name string, value any) Provider

type Provider added in v4.29.2

type Provider interface {
	WithField(name string, value any) Provider
	Trace(format string, a ...any)
	Debug(format string, a ...any)
	Info(format string, a ...any)
	Warn(format string, a ...any)
	Error(format string, a ...any)
	Fatal(err error)
}

func WithField added in v4.7.1

func WithField(name string, value any) Provider

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL