logging

package
v0.0.30-test2 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildAttributes

func BuildAttributes(ctx context.Context, source string, r *http.Request, extra map[string]interface{}) []interface{}

func NewLogging

func NewLogging(logger *slog.Logger, source string, customAttributeAssigner AttributeManager) mux.MiddlewareFunc

If source is empty, it will be set to "ApiRequestLog" If ANY fields in customAttributeAssigner are empty, or the struct itself is empty, default initializer and assigner will be set

Types

type AttributeManager

type AttributeManager struct {
	AttributeInitializer initFunc    // sets keys for custom attributes at the beginning of ServeHTTP()
	AttributeAssigner    loggingFunc // assigns values for custom attributes after request has completed
}

Jump to

Keyboard shortcuts

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