logging

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConcurrentSafeWriter

type ConcurrentSafeWriter struct {
	Out io.Writer
	// contains filtered or unexported fields
}

ConcurrentSafeWriter is a wrapper around an io.Writer that makes it safe to use concurrently.

func (*ConcurrentSafeWriter) Write

func (w *ConcurrentSafeWriter) Write(p []byte) (n int, err error)

Write writes to the underlying io.Writer, locking the mutex while doing so.

type HTTPClient

type HTTPClient struct {
	Wrapped *http.Client
	Out     io.Writer
}

HTTPClient is a wrapper around http.Client that logs requests and responses.

func (*HTTPClient) Do

func (cli *HTTPClient) Do(req *http.Request) (*http.Response, error)

Do performs an HTTP request and logs the request and response.

Jump to

Keyboard shortcuts

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