Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewLoggerMiddleware ¶
func NewLoggerMiddleware(isStdout bool, writerDir string) (gin.HandlerFunc, error)
func NewLoggerMiddlewareSmoothFail ¶
func NewLoggerMiddlewareSmoothFail(isStdout bool, writerDir string) gin.HandlerFunc
Types ¶
type LogFormatterParams ¶
type LogFormatterParams struct { TimeStamp time.Time `json:"time"` StatusCode int `json:"code"` Latency time.Duration `json:"latency"` ClientIP string `json:"ip"` Method string `json:"method"` Path string `json:"path"` ErrorMessage string `json:"errorMessage"` BodySize int `json:"bodySize"` Keys map[string]interface{} `json:"keys"` }
func (*LogFormatterParams) MethodColor ¶
func (p *LogFormatterParams) MethodColor() string
MethodColor is the ANSI color for appropriately logging http method to a terminal.
func (*LogFormatterParams) ResetColor ¶
func (p *LogFormatterParams) ResetColor() string
ResetColor resets all escape attributes.
func (*LogFormatterParams) StatusCodeColor ¶
func (p *LogFormatterParams) StatusCodeColor() string
StatusCodeColor is the ANSI color for appropriately logging http status code to a terminal.
Click to show internal directories.
Click to hide internal directories.