journal

package
v0.12.2 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

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