logger

package
v4.55.2 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2023 License: MIT Imports: 10 Imported by: 30 modules, 56 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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