goaslog

package
v1.6.2 Latest Latest
Warning

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

Go to latest
Published: May 9, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package goaslog contains an adapter that makes it possible to configure goa so it uses log/slog as logger backend. Usage:

handler := slog.NewJSONHandler(os.Stderr, nil)
// Initialize logger handler using [log/slog] package
service.WithLogger(goaslog.New(handler))
// ... Proceed with configuring and starting the goa service

// In handlers:
goaslog.Entry(ctx).Info("foo", "bar")

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(handler slog.Handler) goa.LogAdapter

New wraps a log/slog.Handler into a goa logger.

Types

This section is empty.

Jump to

Keyboard shortcuts

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