Explorar o código

关闭 gin 日志 fix #188

Signed-off-by: allan716 <[email protected]>
allan716 %!s(int64=3) %!d(string=hai) anos
pai
achega
a93ae6d884
Modificáronse 1 ficheiros con 4 adicións e 0 borrados
  1. 4 0
      internal/backend/backend.go

+ 4 - 0
internal/backend/backend.go

@@ -8,12 +8,16 @@ import (
 	"github.com/allanpk716/ChineseSubFinder/internal/pkg/log_helper"
 	"github.com/gin-contrib/cors"
 	"github.com/gin-gonic/gin"
+	"io/ioutil"
 	"net/http"
 )
 
 // StartBackEnd 开启后端的服务器
 func StartBackEnd(httpPort int, cronHelper *cron_helper.CronHelper) {
 
+	gin.SetMode(gin.ReleaseMode)
+	gin.DefaultWriter = ioutil.Discard
+
 	engine := gin.Default()
 	// 默认所有都通过
 	engine.Use(cors.Default())