slog

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 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 Context added in v0.2.5

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

func (*Context) Bool added in v0.2.5

func (c *Context) Bool(key string, val bool) types.Context

func (*Context) Err added in v0.2.5

func (c *Context) Err(err error) types.Context

func (*Context) Float32 added in v0.2.5

func (c *Context) Float32(key string, val float32) types.Context

func (*Context) Float64 added in v0.2.5

func (c *Context) Float64(key string, val float64) types.Context

func (*Context) IPAddr added in v0.2.5

func (c *Context) IPAddr(key string, ipAddr net.IP) types.Context

func (*Context) Int added in v0.2.5

func (c *Context) Int(key string, val int) types.Context

func (*Context) Int16 added in v0.2.5

func (c *Context) Int16(key string, val int16) types.Context

func (*Context) Int32 added in v0.2.5

func (c *Context) Int32(key string, val int32) types.Context

func (*Context) Int64 added in v0.2.5

func (c *Context) Int64(key string, val int64) types.Context

func (*Context) Int8 added in v0.2.5

func (c *Context) Int8(key string, val int8) types.Context

func (*Context) Logger added in v0.2.5

func (c *Context) Logger() types.Logger

func (*Context) MACAddr added in v0.2.5

func (c *Context) MACAddr(key string, macAddr net.HardwareAddr) types.Context

func (*Context) Str added in v0.2.5

func (c *Context) Str(key string, val string) types.Context

func (*Context) Uint added in v0.2.5

func (c *Context) Uint(key string, val uint) types.Context

func (*Context) Uint16 added in v0.2.5

func (c *Context) Uint16(key string, val uint16) types.Context

func (*Context) Uint32 added in v0.2.5

func (c *Context) Uint32(key string, val uint32) types.Context

func (*Context) Uint64 added in v0.2.5

func (c *Context) Uint64(key string, val uint64) types.Context

func (*Context) Uint8 added in v0.2.5

func (c *Context) Uint8(key string, val uint8) types.Context

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) Level added in v0.2.4

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

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

func (*Logger) With added in v0.2.5

func (s *Logger) With() types.Context

Jump to

Keyboard shortcuts

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