slog

package
v0.8.2 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: Apache-2.0 Imports: 5 Imported by: 6

Documentation

Index

Constants

View Source
const (
	LevelDebug = slog.LevelDebug
	LevelInfo  = slog.LevelInfo
	LevelWarn  = slog.LevelWarn
	LevelError = slog.LevelError

	KindAny = slog.KindAny
)

Variables

This section is empty.

Functions

func Any added in v0.7.2

func Any(k string, v any) slog.Attr

func AnyValue added in v0.7.3

func AnyValue(v any) slog.Value

func Bool added in v0.7.2

func Bool(k string, v bool) slog.Attr

func BoolValue added in v0.7.3

func BoolValue(v bool) slog.Value

func Debug added in v0.7.3

func Debug(msg string, args ...any)

func DebugContext added in v0.7.3

func DebugContext(ctx context.Context, msg string, args ...any)

func Default

func Default() *slog.Logger

func Duration added in v0.7.2

func Duration(k string, v time.Duration) slog.Attr

func DurationValue added in v0.7.3

func DurationValue(v time.Duration) slog.Value

func Error added in v0.7.3

func Error(msg string, args ...any)

func ErrorContext added in v0.7.3

func ErrorContext(ctx context.Context, msg string, args ...any)

func Float64 added in v0.7.2

func Float64(k string, v float64) slog.Attr

func Float64Value added in v0.7.3

func Float64Value(v float64) slog.Value

func Group added in v0.7.2

func Group(k string, args ...any) slog.Attr

func GroupValue added in v0.7.3

func GroupValue(as ...Attr) slog.Value

func Info added in v0.7.3

func Info(msg string, args ...any)

func InfoContext added in v0.7.3

func InfoContext(ctx context.Context, msg string, args ...any)

func Int added in v0.7.2

func Int(k string, v int) slog.Attr

func Int64 added in v0.7.2

func Int64(k string, v int64) slog.Attr

func Int64Value added in v0.7.3

func Int64Value(v int64) slog.Value

func IntValue added in v0.7.3

func IntValue(v int) slog.Value

func Log added in v0.7.3

func Log(ctx context.Context, level slog.Level, msg string, args ...any)

func LogAttrs added in v0.7.3

func LogAttrs(ctx context.Context, level slog.Level, msg string, attrs ...Attr)

func New

func New(h slog.Handler) *slog.Logger

func NewLogLogger added in v0.7.3

func NewLogLogger(h Handler, level slog.Level) *log.Logger

func NewRecord

func NewRecord(t time.Time, lvl slog.Level, s string, p uintptr) slog.Record

func SetDefault added in v0.7.3

func SetDefault(l *slog.Logger)

func String

func String(k, v string) slog.Attr

func StringValue

func StringValue(value string) slog.Value

func Time added in v0.7.2

func Time(k string, v time.Time) slog.Attr

func TimeValue added in v0.7.3

func TimeValue(v time.Time) slog.Value

func Uint64 added in v0.7.2

func Uint64(k string, v uint64) slog.Attr

func Uint64Value added in v0.7.3

func Uint64Value(v uint64) slog.Value

func Warn added in v0.7.3

func Warn(msg string, args ...any)

func WarnContext added in v0.7.3

func WarnContext(ctx context.Context, msg string, args ...any)

func With added in v0.7.3

func With(args ...any) *slog.Logger

Types

type Attr

type Attr = slog.Attr

type Handler

type Handler = slog.Handler

func NewJSONHandler

func NewJSONHandler(w io.Writer, opts *HandlerOptions) Handler

type HandlerOptions

type HandlerOptions = slog.HandlerOptions

type JSONHandler added in v0.7.3

type JSONHandler = slog.JSONHandler

type Kind added in v0.7.3

type Kind = slog.Kind

type Level

type Level = slog.Level

type LevelVar

type LevelVar = slog.LevelVar

type Leveler

type Leveler = slog.Leveler

type LogValuer added in v0.7.3

type LogValuer = slog.LogValuer

type Logger

type Logger = slog.Logger

type Record

type Record = slog.Record

type Source added in v0.7.3

type Source = slog.Source

type TextHandler added in v0.7.3

type TextHandler = slog.TextHandler

func NewTextHandler added in v0.7.3

func NewTextHandler(w io.Writer, opts *HandlerOptions) *TextHandler

type Value added in v0.7.3

type Value = slog.Value

Jump to

Keyboard shortcuts

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