logging

package
v1.0.18 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultFormat = "2006-01-02T15:04:05.999Z0700"
)

Variables

This section is empty.

Functions

func Client

func Client(opts ...Option) middleware.Middleware

Client is an client logging middleware.

func Server

func Server(opts ...Option) middleware.Middleware

Server is an client logging middleware.

Types

type Option added in v1.0.14

type Option func(o *Options)

Option is the option for the logger.

func WithDisabled added in v1.0.14

func WithDisabled(disabled bool) Option

WithDisabled set disabled metrics.

func WithHandler added in v1.0.14

func WithHandler(handler func(ctx context.Context, req any) map[string]string) Option

WithHandler sets the handler

func WithLogger added in v1.0.14

func WithLogger(log logger.Logger) Option

WithLogger sets the logger

func WithSlowThreshold added in v1.0.14

func WithSlowThreshold(threshold time.Duration) Option

WithSlowThreshold sets the slow threshold.

func WithTimeFormat added in v1.0.14

func WithTimeFormat(format string) Option

WithTimeFormat sets the format of the time

type Options added in v1.0.14

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

Options is the options for the logger.

type Redacter

type Redacter interface {
	Redact() string
}

Redacter defines how to log an object

Jump to

Keyboard shortcuts

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