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