loghttp

package
v0.8.5 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2025 License: Apache-2.0 Imports: 4 Imported by: 1

Documentation

Overview

Copyright 2024 Tamas Gulacsi. All rights reserved. Copyright 2023 Jamie Tama. All rights reserved.

Package loghttp is from https://www.jvt.me/posts/2023/03/11/go-debug-http/

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithLevel

func WithLevel(lvl slog.Leveler) option

WithLevel allows seting then log level.

Types

type LoggingTransport

type LoggingTransport struct {
	LogLevel  slog.Leveler
	Transport http.RoundTripper
}

func Transport

func Transport(tr http.RoundTripper, opts ...option) LoggingTransport

Transport returns a transport that logs requests and responses.

func (LoggingTransport) RoundTrip

func (s LoggingTransport) RoundTrip(r *http.Request) (*http.Response, error)

Jump to

Keyboard shortcuts

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