logger

package
v1.0.10 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2025 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New() *slog.Logger

Types

type ZerologHandler

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

ZerologHandler is a custom handler that adapts slog to zerolog

func (*ZerologHandler) Enabled

func (h *ZerologHandler) Enabled(_ context.Context, level slog.Level) bool

Enabled implements the slog.Handler interface

func (*ZerologHandler) Handle

func (h *ZerologHandler) Handle(_ context.Context, record slog.Record) error

Handle implements the slog.Handler interface

func (*ZerologHandler) WithAttrs

func (h *ZerologHandler) WithAttrs(attrs []slog.Attr) slog.Handler

WithAttrs adds attributes to the log event

func (*ZerologHandler) WithGroup

func (h *ZerologHandler) WithGroup(name string) slog.Handler

WithGroup returns the handler for a group of logs

Jump to

Keyboard shortcuts

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