journal

package
v0.26.0 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2026 License: Apache-2.0 Imports: 7 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Log

func Log(ctx context.Context, msg string, args ...any)

Log adds a new Entry to the journal in the provided context. Log is not thread-safe.

func New

func New(ctx context.Context) context.Context

New creates a slice of Entries in the provided context.

Types

type CtxKey

type CtxKey string
const Name CtxKey = "journal"

type Entry

type Entry struct {
	Msg    string         `json:"msg"`
	Args   map[string]any `json:"args,omitempty"`
	Source slog.Source    `json:"source"`
	Time   string         `json:"time"`
}

func Journal

func Journal(ctx context.Context) []Entry

Journal returns the journal from the provided context.

Jump to

Keyboard shortcuts

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