diagnostics

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2026 License: MPL-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package diagnostics provides opt-in, command-scoped progress on stderr. Callers must supply only public operational metadata, never credentials, command arguments, environments, request bodies, or unfiltered errors.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Level

func Level(ctx context.Context) int

Level returns zero when diagnostics have not been enabled.

func Printf

func Printf(ctx context.Context, minimum int, format string, args ...any)

Printf writes one diagnostic line when its minimum level is enabled. Formats and arguments must be explicitly selected non-secret metadata.

func Time

func Time(ctx context.Context, operation string) func()

Time returns a completion callback for a named operation at level three. Typical use: defer diagnostics.Time(ctx, "verify release")().

func With

func With(ctx context.Context, level int, out io.Writer) context.Context

With enables up to three cumulative levels: phases, details, and timings. A nil writer discards diagnostics. Child contexts retain cancellation.

Types

type Transport

type Transport struct{ Base http.RoundTripper }

Transport reports request methods, destination origins and response status. URL paths, queries, userinfo, headers, bodies and error strings are omitted: even a failed transport error can contain an entire credential-bearing URL.

func (Transport) CloseIdleConnections

func (t Transport) CloseIdleConnections()

CloseIdleConnections preserves http.Client's transport cleanup contract.

func (Transport) RoundTrip

func (t Transport) RoundTrip(req *http.Request) (*http.Response, error)

Jump to

Keyboard shortcuts

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