diagnostics

package
v1.9.2 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2026 License: MIT Imports: 23 Imported by: 0

Documentation

Overview

Package diagnostics persists bounded structured logs and exports local runtime diagnostics.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Error

func Error(err error) slog.Attr

func ID

func ID(value string) string

ID permits matching one opaque media identity across separately exported reports.

func MediaLogger

func MediaLogger(scope string) medialog.Logger

func PionLoggerFactory

func PionLoggerFactory(fields ...any) logging.LoggerFactory

func ReplaceAttr

func ReplaceAttr(_ []string, attr slog.Attr) slog.Attr

ReplaceAttr applies the same secret policy to application and dependency records.

func SafeText

func SafeText(text string) string

SafeText preserves technical causes and system codes, not authentication material. It is deliberately not a promise to anonymize system paths or network addresses.

Types

type LineWriter

type LineWriter struct {
	// contains filtered or unexported fields
}

LineWriter turns dependency stderr into bounded records without writing on the TUI.

func Writer

func Writer(scope string) *LineWriter

func (*LineWriter) Close

func (writer *LineWriter) Close() error

func (*LineWriter) Write

func (writer *LineWriter) Write(data []byte) (int, error)

type Recorder

type Recorder struct {
	// contains filtered or unexported fields
}

func Open

func Open(directory, component, revision string) (*Recorder, error)

Open appends to the component's current log, retaining one rotated backup. Callers own the directory choice and must pass sanitized structured events.

func (*Recorder) Binary

func (r *Recorder) Binary(name, path string)

Binary records only the identity of an explicitly selected runtime executable.

func (*Recorder) Close

func (r *Recorder) Close() error

Close waits for an export already in progress. It is safe to call repeatedly.

func (*Recorder) Context

func (r *Recorder) Context(name string, value any)

Context snapshots explicitly selected startup facts; it never reads environment files.

func (*Recorder) Export

func (r *Recorder) Export() (path string, returnedErr error)

Export retains useful evidence even when an optional collector fails. It never forces GC or collects raw process memory, media or arbitrary directory contents.

func (*Recorder) LastExportPath added in v1.4.0

func (r *Recorder) LastExportPath() string

LastExportPath returns the latest successfully closed archive, including after Close.

func (*Recorder) LogPath

func (r *Recorder) LogPath() string

func (*Recorder) Logger

func (r *Recorder) Logger() *slog.Logger

Jump to

Keyboard shortcuts

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