slog

package
v0.4.8 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package slog exposes a Grip sender that delegates log output to any std-library slog.Logger. It enables code written for Grip (github.com/tychoish/grip) to emit structured or unstructured records through slog without losing level fidelity or contextual data.

Filtering behaviour

The Sender honours both its own grip-level Priority filter (evaluated by send.ShouldLog) and the slog.Logger's Handler-level filter (Handler().Enabled). The Grip filter always runs first; therefore decreasing the sender's Priority will not cause log events to bypass the slog.Handler, and increasing the Priority cannot force the Handler to accept records it would otherwise discard. In other words, the most restrictive filter between Grip and slog ultimately determines whether a record is emitted.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeSender

func MakeSender(ctx context.Context, logger *slog.Logger) send.Sender

MakeSender constructs a new send.Sender that wraps the provided slog.Logger and uses the supplied context for all log events.

Types

This section is empty.

Jump to

Keyboard shortcuts

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