slog

package
v1.4.3 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package slog renders pry records through a log/slog handler.

A JSONHandler writes time/msg/INFO where pry/zerolog writes time-or-@timestamp/message/info, so a pipeline keyed on the zerolog spelling needs HandlerOptions.ReplaceAttr. See the README.

Index

Constants

View Source
const LevelTrace = slog.LevelDebug - 4

slog's scale starts at Debug, so trace is an ordinary int below it.

Variables

This section is empty.

Functions

This section is empty.

Types

type Driver

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

func New

func New(handler slog.Handler) *Driver

New builds the driver over a handler the caller owns.

The handler keeps its own level, so the effective one is the stricter of the two. Open the pry logger at trace to let the handler decide alone.

func (*Driver) Log

func (d *Driver) Log(r pry.Record)

Jump to

Keyboard shortcuts

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