package
0.0.0-20150525123549-4f29e573b75d
Repository: https://github.com/dogenzaka/gin-tools.git
Documentation: pkg.go.dev
# README
Logging
Installation
$ go get github.com/dogenzaka/gin-tools/logging
Requirements
Tests
Example
func main() {
r := gin.Default()
r.Use(logging.AccessLogger(os.Stdout))
r.GET("/user/:name", func(c *gin.Context) {
name := c.Params.ByName("name")
message := "Hello "+name
c.String(200, message)
})
r.Run(":8080")
}
# Functions
AccessLogger is a middleware for logging access info.
ActivityLogger is a middleware for logging user action info.
ConvertToMapFromBody converts to a map from a request body.
GenerateLogInfo generates base log information.
SetRecoverLoggingFailure is a set recoverLoggingFailure.
# Structs
AccessLog is a log information of user access.
ActivityLog is a log information of user action.
LogInfo is a base log information.