handler

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetInternalLogger

func GetInternalLogger() *slog.Logger

GetInternalLogger returns the internal logger used by logbundle (without source)

Types

type CustomHandler

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

CustomHandler implements slog.Handler with custom formatting Format: "YYYY/MM/DD HH:MM:SS [LEVEL] [file:line] message key=value..."

func NewCustomHandler

func NewCustomHandler(w io.Writer, level slog.Level, addSource bool) *CustomHandler

func (*CustomHandler) Enabled

func (h *CustomHandler) Enabled(ctx context.Context, level slog.Level) bool

func (*CustomHandler) Handle

func (h *CustomHandler) Handle(ctx context.Context, r slog.Record) error

Handle processes a log record and writes it to the output This is the core slog.Handler method

func (*CustomHandler) WithAttrs

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

func (*CustomHandler) WithGroup

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

Jump to

Keyboard shortcuts

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