velocityslog

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: May 8, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package velocityslog bridges log/slog to a velocity Logger.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewLogger

func NewLogger(logger *velocity.Logger) *slog.Logger

NewLogger creates an *slog.Logger backed by a velocity Logger.

Types

type Handler

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

Handler bridges log/slog to a velocity Logger.

func NewHandler

func NewHandler(logger *velocity.Logger) *Handler

NewHandler creates an slog.Handler backed by a velocity Logger.

func (*Handler) Enabled

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

Enabled reports whether the handler handles records at the given level.

func (*Handler) Handle

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

Handle converts a slog.Record to a velocity entry and dispatches it.

func (*Handler) WithAttrs

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

WithAttrs returns a new handler with the given attributes pre-converted.

func (*Handler) WithGroup

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

WithGroup returns a new handler with the given group name pushed onto the stack.

Jump to

Keyboard shortcuts

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