Documentation ¶
Index ¶
- Variables
- func App(name string) slog.Attr
- func Cause(err error) slog.Attr
- func Module(name string) slog.Attr
- type Attr
- func Durationx(key string, value timex.Duration) Attr
- func Float32(key string, value float32) Attr
- func Int16(key string, value int16) Attr
- func Int32(key string, value int32) Attr
- func Int8(key string, value int8) Attr
- func Uint(key string, value uint) Attr
- func Uint16(key string, value uint16) Attr
- func Uint32(key string, value uint32) Attr
- func Uint8(key string, value uint8) Attr
- type Handler
- type Level
- type Leveler
- type Logger
- func (self *Logger) Panic(msg string, args ...any)
- func (self *Logger) PanicContext(ctx context.Context, msg string, args ...any)
- func (self *Logger) Verbose(msg string, args ...any)
- func (self *Logger) VerboseContext(ctx context.Context, msg string, args ...any)
- func (self *Logger) With(args ...any) *Logger
- func (self *Logger) WithGroup(name string) *Logger
Constants ¶
This section is empty.
Variables ¶
var Any = slog.Any
Any returns an Attr for the supplied value. See [AnyValue] for how values are treated.
var Bool = slog.Bool
Bool returns an Attr for a bool.
var Duration = slog.Duration
Duration returns an Attr for a time.Duration.
var Float64 = slog.Float64
Float64 returns an Attr for a floating-point number.
var Group = slog.Group
var Int = slog.Int
Int converts an int to an int64 and returns an Attr with that value.
var Int64 = slog.Int64
Int64 returns an Attr for an int64.
var NewLogLogger = slog.NewLogLogger
NewLogLogger returns a new log.Logger such that each call to its Output method dispatches a Record to the specified handler. The logger acts as a bridge from the older log API to newer structured logging handlers.
var NewRecord = slog.NewRecord
NewRecord creates a [Record] from the given arguments. Use [Record.AddAttrs] to add attributes to the Record.
NewRecord is intended for logging APIs that want to support a Handler as a backend.
var String = slog.String
String returns an Attr for a string value.
var Time = slog.Time
Time returns an Attr for a time.Time. It discards the monotonic portion.
var Uint64 = slog.Uint64
Uint64 returns an Attr for a uint64.
Functions ¶
Types ¶
type Attr ¶
type Handler ¶
func JoinHandlers ¶
JoinHandlers creates a Handler that writes to all handlers in the given list.
Directories ¶
Path | Synopsis |
---|---|
! Original repository: github.com/MatusOllah/slogcolor
|
! Original repository: github.com/MatusOllah/slogcolor |
! Original repository: github.com/lmittmann/tint
|
! Original repository: github.com/lmittmann/tint |