klbslog

package module
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2023 License: MIT Imports: 9 Imported by: 0

README

klbslog

generic slog handler for klb using rest & fleet

Usage:

    slog.SetDefault(slog.New(klbslog.New(nil, nil)))

Or with options and a parent:

    slog.SetDefault(slog.New(klbslog.New(&slog.HandlerOptions{AddSource: true, Level: slog.LevelDebug}, slog.NewTextHandler(os.Stderr, nil))))

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(opts *slog.HandlerOptions, parent slog.Handler) slog.Handler

Types

type SHandler

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

func (*SHandler) Enabled

func (s *SHandler) Enabled(_ context.Context, lvl slog.Level) bool

Enabled returns if SHandler is enabled (note: it always is)

func (*SHandler) Handle

func (s *SHandler) Handle(ctx context.Context, r slog.Record) error

func (*SHandler) WithAttrs

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

func (*SHandler) WithGroup

func (s *SHandler) WithGroup(name string) slog.Handler

Jump to

Keyboard shortcuts

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