example

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2023 License: MPL-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const LevelAlert = slog.Level(12)
View Source
const LevelInfo = slog.Level(0)
View Source
const RequestId = "request_id"

Variables

This section is empty.

Functions

func CreatedAt

func CreatedAt(value time.Time) slog.Attr

func Err

func Err(value error) slog.Attr

func ParseLevel

func ParseLevel(s string) (slog.Level, error)

func RenameLevels

func RenameLevels(_ []string, attr slog.Attr) slog.Attr

func UserId

func UserId(value int) slog.Attr

Types

type Logger

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

func New

func New(h slog.Handler) *Logger

func (*Logger) Alert

func (l *Logger) Alert(ctx context.Context, msg string, attrs ...slog.Attr)

func (*Logger) Enabled

func (l *Logger) Enabled(ctx context.Context, level slog.Level) bool

func (*Logger) Handler

func (l *Logger) Handler() slog.Handler

func (*Logger) Info

func (l *Logger) Info(ctx context.Context, msg string, attrs ...slog.Attr)

func (*Logger) Log

func (l *Logger) Log(ctx context.Context, level slog.Level, msg string, attrs ...slog.Attr)

func (*Logger) With

func (l *Logger) With(attrs ...slog.Attr) *Logger

func (*Logger) WithGroup

func (l *Logger) WithGroup(name string) *Logger

Jump to

Keyboard shortcuts

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