ginlog

package
v0.0.0-...-5ce2329 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Logger

func Logger() gin.HandlerFunc

func LoggerWithConfig

func LoggerWithConfig(conf LoggerConfig) gin.HandlerFunc

func LoggerWithFormatter

func LoggerWithFormatter(f LogFormatter) gin.HandlerFunc

Types

type LogFormatter

type LogFormatter func(params LogFormatterParams) string

type LogFormatterParams

type LogFormatterParams struct {
	gin.LogFormatterParams
	RequestBody  []byte //请求的body内容,只有当为post请求,并且content-type为 application/json 或 application/x-www-form-urlencoded 时才会打输出body
	ResponseData []byte
}

LogFormatterParams is the structure any formatter will be handed when time to log comes

type LoggerConfig

type LoggerConfig struct {
	// Optional. Default value is gin.defaultLogFormatter
	Formatter LogFormatter
}

Jump to

Keyboard shortcuts

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