aurestlogging

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2024 License: MIT Imports: 7 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug added in v0.8.0

func Info added in v0.8.0

func NewWithOptions added in v0.8.0

func Warn added in v0.8.0

Types

type LoggingRoundTripper added in v0.9.0

type LoggingRoundTripper struct {
	Options RequestLoggingOptions
	// contains filtered or unexported fields
}

func NewLoggingRoundTripper added in v0.9.0

func NewLoggingRoundTripper(wrapped http.RoundTripper) *LoggingRoundTripper

func NewLoggingRoundTripperWithOpts added in v0.9.0

func NewLoggingRoundTripperWithOpts(wrapped http.RoundTripper, opts RequestLoggingOptions) *LoggingRoundTripper

func (*LoggingRoundTripper) RoundTrip added in v0.9.0

func (c *LoggingRoundTripper) RoundTrip(req *http.Request) (*http.Response, error)

type RequestLoggingImpl

type RequestLoggingImpl struct {
	Wrapped aurestclientapi.Client
	Options RequestLoggingOptions
}

func (*RequestLoggingImpl) Perform

func (c *RequestLoggingImpl) Perform(ctx context.Context, method string, requestUrl string, requestBody interface{}, response *aurestclientapi.ParsedResponse) error

type RequestLoggingOptions added in v0.8.0

type RequestLoggingOptions struct {
	BeforeRequest func(ctx context.Context) auloggingapi.LeveledLoggingImplementation
	Success       func(ctx context.Context) auloggingapi.LeveledLoggingImplementation
	Failure       func(ctx context.Context) auloggingapi.LeveledLoggingImplementation
}

RequestLoggingOptions allows overriding the log functions used.

This allows easily changing the log level when setting up request logging.

important: do not cache the LeveledLoggingImplementation, create one each time, or some loggers may use cached values.

Jump to

Keyboard shortcuts

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