slog

package
v1.67.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2024 License: Apache-2.0, BSD-3-Clause, Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package slog provides functions to correlate logs and traces using log/slog package (https://pkg.go.dev/log/slog).

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewJSONHandler

func NewJSONHandler(w io.Writer, opts *slog.HandlerOptions) slog.Handler

NewJSONHandler is a convenience function that returns a *slog.JSONHandler logger enhanced with tracing information.

Example
Output:

func WrapHandler

func WrapHandler(h slog.Handler) slog.Handler

WrapHandler enhances the given logger handler attaching tracing information to logs.

Example
Output:

Types

This section is empty.

Jump to

Keyboard shortcuts

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