logger

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewLogger

func NewLogger(level slog.Level) *slog.Logger

func NewLoggerWithFormat

func NewLoggerWithFormat(level slog.Level, format LogFormat) *slog.Logger

Types

type AsyncHandler

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

func NewAsyncHandler

func NewAsyncHandler(handler slog.Handler, bufferSize int) *AsyncHandler

func (*AsyncHandler) Close

func (h *AsyncHandler) Close()

func (*AsyncHandler) Enabled

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

func (*AsyncHandler) Handle

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

func (*AsyncHandler) WithAttrs

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

func (*AsyncHandler) WithGroup

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

type ColoredHandler

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

func NewColoredHandler

func NewColoredHandler(writer io.Writer, level slog.Level) *ColoredHandler

func (*ColoredHandler) Enabled

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

func (*ColoredHandler) Handle

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

func (*ColoredHandler) WithAttrs

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

func (*ColoredHandler) WithGroup

func (h *ColoredHandler) WithGroup(_ string) slog.Handler

type LogFormat

type LogFormat string
const (
	LogFormatJSON    LogFormat = "json"
	LogFormatText    LogFormat = "text"
	LogFormatColored LogFormat = "colored"
)

type MultiHandler

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

func NewMultiHandler

func NewMultiHandler(handlers ...slog.Handler) *MultiHandler

func (*MultiHandler) Enabled

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

func (*MultiHandler) Handle

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

func (*MultiHandler) WithAttrs

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

func (*MultiHandler) WithGroup

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

type SourceFilterHandler

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

func NewSourceFilterHandler

func NewSourceFilterHandler(handler slog.Handler) *SourceFilterHandler

func (*SourceFilterHandler) Enabled

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

func (*SourceFilterHandler) Handle

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

func (*SourceFilterHandler) WithAttrs

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

func (*SourceFilterHandler) WithGroup

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

Jump to

Keyboard shortcuts

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