logging

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package logging contains helpers for logging.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrAttr

func ErrAttr(err error) slog.Attr

ErrAttr provides a slog.Attr to reduce a bit of boilerplate when logging errors. Credits go to https://github.com/golang/go/issues/59364#issuecomment-1493237877.

func NewBufLogHandler added in v0.1.9

func NewBufLogHandler(buf *bytes.Buffer, opts *slog.HandlerOptions) *slog.TextHandler

NewBufLogHandler provides a slog.TextHandler which logs to the provided bytes.Buffer.

func NewNopLogger

func NewNopLogger() *slog.Logger

NewNopLogger provides a NopLogger which uses io.Discard to write logs to.

Types

This section is empty.

Jump to

Keyboard shortcuts

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