logger

package
v1.0.34 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Ginzap

func Ginzap(logger *zap.Logger) gin.HandlerFunc

func GinzapWithConfig

func GinzapWithConfig(logger *zap.Logger, conf *Config) gin.HandlerFunc

GinzapWithConfig returns a gin.HandlerFunc using configs

func RecoveryWithZap

func RecoveryWithZap(logger *zap.Logger, stack bool) gin.HandlerFunc

RecoveryWithZap returns a gin.HandlerFunc (middleware) that recovers from any panics and logs requests using uber-go/zap. All errors are logged using zap.Error(). stack means whether output the stack info. The stack info is easy to find where the error occurs but the stack info is too large.

Types

type Config

type Config struct {
	SkipPaths []string
}

Config is config setting for Ginzap

Jump to

Keyboard shortcuts

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