log

package
v0.0.0-...-e537141 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2023 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AttrArray

type AttrArray interface {
	AddAttr(attr slog.Attr)
	GetAttrs() []slog.Attr
}

type AttrStaticArray

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

func (*AttrStaticArray) Add

func (a *AttrStaticArray) Add(attr slog.Attr)

func (AttrStaticArray) GetAttrs

func (a AttrStaticArray) GetAttrs() []slog.Attr

func (*AttrStaticArray) Reset

func (a *AttrStaticArray) Reset()

type Attrs

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

func NewAttrs

func NewAttrs(array AttrArray) Attrs

func (Attrs) Add

func (a Attrs) Add(attr slog.Attr)

func (Attrs) Any

func (a Attrs) Any(key string, val any)

func (Attrs) Bool

func (a Attrs) Bool(key string, val bool)

func (Attrs) Duration

func (a Attrs) Duration(key string, duration time.Duration)

func (Attrs) Float64

func (a Attrs) Float64(key string, val float64)

func (Attrs) Get

func (a Attrs) Get() []slog.Attr

func (Attrs) Int

func (a Attrs) Int(key string, val int)

func (Attrs) Int64

func (a Attrs) Int64(key string, val int64)

func (Attrs) String

func (a Attrs) String(key string, val string)

func (Attrs) Time

func (a Attrs) Time(key string, val time.Time)

func (Attrs) Uint64

func (a Attrs) Uint64(key string, val uint64)

type NameWithSeparator

type NameWithSeparator struct {
	// KeyConfig will be used to build the value of the component field.
	KeyConfig field.KeyConfig
	// ComponentTag will be used as the key of the component field.
	ComponentTag string
}

func (NameWithSeparator) MakeNamedLogger

func (n NameWithSeparator) MakeNamedLogger(l zerolog.Logger, parts []string) (out zerolog.Logger, err error)

type NamedLoggerMaker

type NamedLoggerMaker interface {
	MakeNamedLogger(l zerolog.Logger, parts []string) (zerolog.Logger, error)
}
NamedLoggerMaker creates a new logger instance with an added field naming

the program component built up from @parts.

Jump to

Keyboard shortcuts

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