gelf

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

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

Handler 兼容 GELF 1.1。

func New

func New(opt Options) *Handler

New 创建 handler。

func (*Handler) Enabled

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

func (*Handler) Handle

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

func (*Handler) WithAttrs

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

func (*Handler) WithGroup

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

type Options

type Options struct {
	Writer      modules.WriteSyncer
	Level       slog.Leveler
	Host        string
	Facility    string
	AddSource   bool
	ReplaceAttr func(groups []string, a slog.Attr) slog.Attr
}

Options 控制 GELF 输出。

Jump to

Keyboard shortcuts

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