slocho

package
v0.0.0-...-f48be0a Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrSkipperNil  = errors.New("skipper is nil")
	ErrLoggerIsNil = errors.New("logger is nil")
)

Functions

func New

func New(opts ...Option) (echo.MiddlewareFunc, error)

Types

type Log

type Log interface {
	LogAttrs(ctx context.Context, level slog.Level, msg string, attrs ...slog.Attr)
}

type Option

type Option interface {
	// contains filtered or unexported methods
}

func Level

func Level(lvl slog.Level) Option

Level sets the level that the logger will write at.

func Logger

func Logger(logger Log) Option

Logger sets the logger to be used.

func Message

func Message(msg string) Option

Message sets the message that is shown for every log entry.

func Skipper

func Skipper(sk middleware.Skipper) Option

Skipper lets you use the skipper of your choice.

func WithFormValues

func WithFormValues(list ...string) Option

WithFormValues lets you choose which form values you want added to the log entry.

func WithHeaders

func WithHeaders(list ...string) Option

WithHeaders lets you choose which headers you want added to the log entry.

func WithQueryParams

func WithQueryParams(list ...string) Option

WithQueryParams lets you choose which query params you want added to the log entry.

Jump to

Keyboard shortcuts

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