logger

package
v1.3.2 Latest Latest
Warning

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

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

Documentation

Overview

Package logger provides utilities for working with slog and context.Context, as well as a Temporal log.Logger wrapper for them.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Fatal

func Fatal(msg string, err error, attrs ...slog.Attr)

func FatalContext

func FatalContext(ctx context.Context, msg string, err error, attrs ...slog.Attr)

func From

func From(ctx workflow.Context) log.Logger

From returns a Temporal log.Logger that wraps a slog.Logger which is attached to the specified Temporal workflow.Context. If the context is nil, it returns slog.Default as a fallback, which still satisfies the log.Logger interface.

func FromContext

func FromContext(ctx context.Context) *slog.Logger

FromContext returns the slog.Logger attached to the given context.Context, or slog.Default if none is attached.

func WithContext

func WithContext(ctx context.Context, l *slog.Logger) context.Context

WithContext returns a derived context.Context that points to the given parent, and has the given slog.Logger attached to it.

Types

This section is empty.

Jump to

Keyboard shortcuts

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