Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ErrorLogger ¶
func ErrorLogger() gin.HandlerFunc
ErrorLogger returns an ErrorLoggerT with parameter gin.ErrorTypeAny
func ErrorLoggerT ¶
func ErrorLoggerT(typ gin.ErrorType) gin.HandlerFunc
ErrorLoggerT returns an ErrorLoggerT middleware with the given type gin.ErrorType.
func LogAdapter ¶
func LogAdapter(fn func(c *gin.Context)) gin.HandlerFunc
LogAdapter returns a new LogAdapter wrapper around the passed logger. It formats the log entries similar to http://godoc.org/github.com/gin-gonic/gin#Logger does.
Example:
router := gin.New() router.Use(gokitlog.LogAdapter(func(c *gin.Context){ latency,_ := c.Get("latency") logger.Log( "latency",latency,"clientIP",c.ClientIP(), "status",c.Writer.Status(),"err",c.Errors.String()) })
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.