logger

package
v0.0.0-...-6b2826c Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2024 License: AGPL-3.0 Imports: 7 Imported by: 47

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Critical

func Critical(ctx context.Context, msg string, fields ...any)

func Debug

func Debug(ctx context.Context, msg string, fields ...any)

func Error

func Error(ctx context.Context, msg string, fields ...any)

func Fatal

func Fatal(ctx context.Context, msg string, fields ...any)

func Info

func Info(ctx context.Context, msg string, fields ...any)

func Make

func Make(f Format, w io.Writer) slog.Logger

func SetCaptureFunc

func SetCaptureFunc(fn CaptureFunc)

func SetFormat

func SetFormat(format Format)

func SetLevel

func SetLevel(level Level)

func Warn

func Warn(ctx context.Context, msg string, fields ...any)

func With

func With(ctx context.Context, fields ...Field) context.Context

Types

type CaptureFunc

type CaptureFunc func(err error)

type Field

type Field = slog.Field

func CapturedE

func CapturedE(err error) Field

func E

func E(err error) Field

func F

func F(name string, value interface{}) Field

type Format

type Format string
const (
	FormatHuman Format = "human"
	FormatJSON  Format = "json"
)

type Level

type Level = slog.Level
const (
	LevelCritical Level = slog.LevelCritical
	LevelError    Level = slog.LevelError
	LevelWarn     Level = slog.LevelWarn
	LevelInfo     Level = slog.LevelInfo
	LevelDebug    Level = slog.LevelDebug
)

type Map

type Map = slog.Map

func M

func M(fields ...Field) Map

Jump to

Keyboard shortcuts

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