clog

package module
v0.0.0-...-cf7a88a Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2023 License: MIT Imports: 4 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithAttrs

func WithAttrs(logger *slog.Logger, ctx context.Context, level slog.Level, msg string, attrs ...slog.Attr)

func WithParams

func WithParams(logger *slog.Logger, ctx context.Context, params Params)

Types

type ParamGroup

type ParamGroup map[string]any

func (ParamGroup) Clone

func (pg ParamGroup) Clone() ParamGroup

func (ParamGroup) Count

func (pg ParamGroup) Count() int

func (ParamGroup) Delete

func (pg ParamGroup) Delete(key string)

func (ParamGroup) Exists

func (pg ParamGroup) Exists(key string) bool

func (ParamGroup) Get

func (pg ParamGroup) Get(key string) (v any, exists bool)

func (ParamGroup) LogValue

func (pg ParamGroup) LogValue() (value slog.Value)

func (*ParamGroup) Set

func (pg *ParamGroup) Set(key string, v any)

type Params

type Params struct {
	Message string
	Level   slog.Level
	Err     error

	ForceLevel bool
	ExcludeErr bool

	Values ParamGroup
}

func (*Params) Clone

func (lp *Params) Clone() Params

func (*Params) Delete

func (lp *Params) Delete(key string)

func (*Params) Exists

func (lp *Params) Exists(key string) bool

func (*Params) Get

func (lp *Params) Get(key string) (v any, exists bool)

func (*Params) LogValue

func (lp *Params) LogValue() slog.Value

func (*Params) Serialize

func (lp *Params) Serialize() (attrs []slog.Attr, level slog.Level)

func (*Params) Set

func (lp *Params) Set(key string, v any)

Jump to

Keyboard shortcuts

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