Skip logging non-api routes

Signed-off-by: Steven Kriegler <sk.bunsenbrenner@gmail.com>
This commit is contained in:
justusbunsi 2022-05-15 16:03:19 +02:00
parent f59a6530b8
commit 34e2783cb1
No known key found for this signature in database
GPG key ID: 82B29BF2507F9F8B

View file

@ -68,7 +68,12 @@ func addGiteaEndpoint(r *gin.Engine) {
func Serve(c *cli.Context) error {
fmt.Println("Hi! I'm the Gitea-SonarQube-PR bot. At your service.")
r := gin.Default()
r := gin.New()
r.Use(gin.Recovery())
r.Use(gin.LoggerWithConfig(gin.LoggerConfig{
SkipPaths: []string{"/ping", "/favicon.ico"},
}))
addPingApi(r)
addSonarQubeEndpoint(r)