pslog

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2025 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package pslog provides a plug-in otter.Logger wrapping slog.Logger for usage in an otter.Cache.

This can be used like so:

	cache := otter.Must(&otter.Options[string, string]{
         Logger: pslog.New(slog.Default()),
	     // ...other opts
	})

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Logger

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

Logger that wraps the slog.Logger.

func New

func New(log *slog.Logger, opts ...Option) *Logger

New returns a new Logger.

func (*Logger) Error

func (l *Logger) Error(ctx context.Context, msg string, err error)

Error is for the otter.Logger interface.

func (*Logger) Warn

func (l *Logger) Warn(ctx context.Context, msg string, err error)

Warn is for the otter.Logger interface.

type Option

type Option func(*options)

Option applies options to the logger.

Jump to

Keyboard shortcuts

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