log

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewLoggerConfig added in v0.0.2

func NewLoggerConfig(level slog.Level, opts ...LoggerConfigOption) *types.LoggerConfig

func RequestLogger

func RequestLogger(opt types.LoggerConfig) gin.HandlerFunc

RequestLogger 用于打印每个请求的详细信息 默认使用 slog 库提供的默认实例进行打印,也可以传入一个 logger 实例

Types

type LoggerConfigOption added in v0.1.0

type LoggerConfigOption func(config *types.LoggerConfig)

func WithOptionalLogger added in v0.0.2

func WithOptionalLogger(optionalLogger *slog.Logger) LoggerConfigOption

func WithSkipFunc added in v0.1.2

func WithSkipFunc(skipFunc func(ctx *gin.Context) bool) LoggerConfigOption

func WithSkipPaths added in v0.1.0

func WithSkipPaths(skipPaths []string) LoggerConfigOption

Jump to

Keyboard shortcuts

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