This commit is contained in:
lwl0608 2024-05-16 23:18:24 +08:00
parent a05451e99a
commit 1b2769d429
1 changed files with 4 additions and 1 deletions

View File

@ -5,6 +5,7 @@ import (
"fmt" "fmt"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
"service/library/logger" "service/library/logger"
"strings"
"time" "time"
) )
@ -91,7 +92,9 @@ func LoggerMiddleware(conf gin.LoggerConfig) gin.HandlerFunc {
bodyStr = string(body.([]byte)) bodyStr = string(body.([]byte))
} }
logger.Info("%s params: %s", formatter(param), bodyStr) logger.Info("%s params: %s", formatter(param), bodyStr)
//logger.Info("%s response: %s", formatter(param), blw.body.String()) if strings.Contains(param.Path, "is_there_a_new_version_available") {
logger.Info("%s response: %s", formatter(param), blw.body.String())
}
//logger.WithCtx(c.Request.Context()).Info("%s params: %s", formatter(param), bodyStr) //logger.WithCtx(c.Request.Context()).Info("%s params: %s", formatter(param), bodyStr)
//if accessConf.LogResponseEnabled { //if accessConf.LogResponseEnabled {