logger

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2024 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ProjectID = "project_id"
	RequestID = "request_id"
)

Variables

This section is empty.

Functions

func Error

func Error(err error) slog.Attr

func New

func New(name string) *slog.Logger

Types

type ContextHandler

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

func NewContextHandler

func NewContextHandler(baseHandler slog.Handler) *ContextHandler

func (*ContextHandler) Enabled

func (c *ContextHandler) Enabled(ctx context.Context, level slog.Level) bool

func (*ContextHandler) Handle

func (c *ContextHandler) Handle(ctx context.Context, record slog.Record) error

func (*ContextHandler) WithAttrs

func (c *ContextHandler) WithAttrs(attrs []slog.Attr) slog.Handler

func (*ContextHandler) WithGroup

func (c *ContextHandler) WithGroup(name string) slog.Handler

Jump to

Keyboard shortcuts

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