Help us shape the future of Go! Take the 2026 Go Developer Survey

logging

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// LogSourceRestate logs come from the sdk-go library
	LogSourceRestate = iota
	// LogSourceUser logs come from user handlers that use the Context.Log() logger.
	LogSourceUser
)

Variables

This section is empty.

Functions

func WithLogContext

func WithLogContext(parent context.Context, logContext *LogContext) context.Context

WithLogContext stores a LogContext in the provided context.Context, returning a new context

Types

type LogContext

type LogContext struct {
	// The source of the logline
	Source LogSource
	// Whether the user code is currently replaying
	IsReplaying bool
}

LogContext contains information stored in the context that is passed to loggers

func LogContextFrom

func LogContextFrom(ctx context.Context) *LogContext

LogContextFrom retrieves the LogContext stored in this context.Context, or otherwise returns nil

type LogSource

type LogSource int

LogSource is an enum to describe the source of a logline

Jump to

Keyboard shortcuts

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