logging

package
v1.0.21 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 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 Metadata added in v1.0.19

type Metadata struct {
	Key    string // key
	Rename string // rename
}

type Option added in v1.0.14

type Option func(o *Options)

Option is the option for the logger.

func WithAccessLevel added in v1.0.19

func WithAccessLevel(level logger.Level) Option

WithAccessLevel sets the access level

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 WithIgnoredRoutes added in v1.0.19

func WithIgnoredRoutes(routes []string) Option

WithIgnoredRoutes sets the ignored routes

func WithLogger added in v1.0.14

func WithLogger(log logger.Logger) Option

WithLogger sets the logger

func WithMetadata added in v1.0.19

func WithMetadata(md []Metadata) Option

WithMetadata sets the metadata

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 {
	Metadata []Metadata
	// 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