Documentation ¶ Index ¶ type Handler func New(opt Options) *Handler func (h *Handler) Enabled(_ context.Context, l slog.Level) bool func (h *Handler) Handle(_ context.Context, r slog.Record) error func (h *Handler) WithAttrs(attrs []slog.Attr) slog.Handler func (h *Handler) WithGroup(name string) slog.Handler type Options 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 输出。 Source Files ¶ View all Source files handler.go Click to show internal directories. Click to hide internal directories.