mocklogger

package
v0.0.0-...-36d6306 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMockLogger

func NewMockLogger() *slog.Logger

NewMockLogger creates a new logger with the mock handler

Types

type MockHandler

type MockHandler struct {

	// You can add fields here to track calls for testing if needed
	// For example:
	LoggedMessages []string
	LoggedLevels   []slog.Level
	// contains filtered or unexported fields
}

MockHandler is a mock implementation of slog.Handler

func (*MockHandler) Enabled

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

Enabled implements slog.Handler.

func (*MockHandler) Handle

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

Handle implements slog.Handler.

func (*MockHandler) WithAttrs

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

WithAttrs implements slog.Handler.

func (*MockHandler) WithGroup

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

WithGroup implements slog.Handler.

Jump to

Keyboard shortcuts

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