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
Click to show internal directories.
Click to hide internal directories.