slog

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ReplaceAttr = func(_ []string, a slog.Attr) slog.Attr {
		switch a.Key {
		case slog.TimeKey:
			a.Key = types.TimestampKey
		}
		return a
	}
)

Functions

This section is empty.

Types

type Event

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

func (*Event) Bool

func (e *Event) Bool(key string, val bool) types.Event

func (*Event) Err

func (e *Event) Err(err error) types.Event

func (*Event) Float32

func (e *Event) Float32(key string, val float32) types.Event

func (*Event) Float64

func (e *Event) Float64(key string, val float64) types.Event

func (*Event) IPAddr

func (e *Event) IPAddr(key string, ipAddr net.IP) types.Event

func (*Event) Int

func (e *Event) Int(key string, val int) types.Event

func (*Event) Int16

func (e *Event) Int16(key string, val int16) types.Event

func (*Event) Int32

func (e *Event) Int32(key string, val int32) types.Event

func (*Event) Int64

func (e *Event) Int64(key string, val int64) types.Event

func (*Event) Int8

func (e *Event) Int8(key string, val int8) types.Event

func (*Event) MACAddr

func (e *Event) MACAddr(key string, macAddr net.HardwareAddr) types.Event

func (*Event) Msg

func (e *Event) Msg(msg string)

func (*Event) Msgf

func (e *Event) Msgf(format string, args ...interface{})

func (*Event) Str

func (e *Event) Str(key string, val string) types.Event

func (*Event) Uint

func (e *Event) Uint(key string, val uint) types.Event

func (*Event) Uint16

func (e *Event) Uint16(key string, val uint16) types.Event

func (*Event) Uint32

func (e *Event) Uint32(key string, val uint32) types.Event

func (*Event) Uint64

func (e *Event) Uint64(key string, val uint64) types.Event

func (*Event) Uint8

func (e *Event) Uint8(key string, val uint8) types.Event

type Logger

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

func New

func New(source string, level types.Level, output io.Writer) *Logger

func (*Logger) Debug

func (s *Logger) Debug() types.Event

func (*Logger) Error

func (s *Logger) Error() types.Event

func (*Logger) Fatal

func (s *Logger) Fatal() types.Event

func (*Logger) Info

func (s *Logger) Info() types.Event

func (*Logger) SetLevel

func (s *Logger) SetLevel(level types.Level)

func (*Logger) SubLogger

func (s *Logger) SubLogger(source string) types.Logger

func (*Logger) Trace

func (s *Logger) Trace() types.Event

func (*Logger) Warn

func (s *Logger) Warn() types.Event

Jump to

Keyboard shortcuts

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