httpslog

package
v0.22.0 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2025 License: GPL-3.0 Imports: 5 Imported by: 1

Documentation

Overview

Package httpslog implements structured logging for HTTP clients.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MaybeLogRoundTripDone

func MaybeLogRoundTripDone(
	logger *slog.Logger,
	localAddr netip.AddrPort,
	protocol string,
	remoteAddr netip.AddrPort,
	req *http.Request,
	resp *http.Response,
	err error,
	t0 time.Time,
	t time.Time,
)

MaybeLogRoundTripDone logs the end of a round trip if the given logger is not nil, otherwise it does nothing.

func MaybeLogRoundTripStart

func MaybeLogRoundTripStart(
	logger *slog.Logger,
	localAddr netip.AddrPort,
	protocol string,
	remoteAddr netip.AddrPort,
	req *http.Request,
	t0 time.Time,
)

MaybeLogRoundTripStart logs the start of a round trip if the given logger is not nil, otherwise it does nothing.

Types

This section is empty.

Jump to

Keyboard shortcuts

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