slogr

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2023 License: Apache-2.0 Imports: 2 Imported by: 4

Documentation

Overview

Package slogr enables usage of a slog.Handler with logr.Logger as front-end API and of a logr.LogSink through the slog.Handler and thus slog.Logger APIs.

See the README in the top-level [./logr] package for a discussion of interoperability.

Deprecated: use the main logr package instead.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewLogr deprecated

func NewLogr(handler slog.Handler) logr.Logger

NewLogr returns a logr.Logger which writes to the slog.Handler.

Deprecated: use logr.FromSlogHandler instead.

func NewSlogHandler deprecated

func NewSlogHandler(logger logr.Logger) slog.Handler

NewSlogHandler returns a slog.Handler which writes to the same sink as the logr.Logger.

Deprecated: use logr.ToSlogHandler instead.

func ToSlogHandler deprecated added in v1.4.0

func ToSlogHandler(logger logr.Logger) slog.Handler

ToSlogHandler returns a slog.Handler which writes to the same sink as the logr.Logger.

Deprecated: use logr.ToSlogHandler instead.

Types

type SlogSink deprecated

type SlogSink = logr.SlogSink

SlogSink is an optional interface that a LogSink can implement to support logging through the slog.Logger or slog.Handler APIs better.

Deprecated: use logr.SlogSink instead.

Jump to

Keyboard shortcuts

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