This repo is DEPRECATED! Use https://github.com/spacetab-io/logs-gin-go instead.
Logger fo gin gonic
Pass logrus instance to constructor.
package main
import (
"time"
ginLogger "github.com/microparts/logs-go-gin"
"github.com/gin-gonic/gin"
"github.com/sirupsen/logrus"
)
func main() {
r := gin.New()
r.Use(ginLogger.NewLogger(logrus.New()), gin.Recovery())
// pingpong
r.GET("/ping", func(c *gin.Context) {
c.Data(200, "text/plain", []byte("pong"))
})
_ = r.Run("127.0.0.1:8080")
}
The software is provided under MIT Licence.