refactor:
- zap.Any("err", err) 更改为 zap.Error(err) 提高性能
This commit is contained in:
@@ -49,7 +49,7 @@ func ErrorToEmail() gin.HandlerFunc {
|
||||
if status != 200 {
|
||||
subject := username + "" + record.Ip + "调用了" + record.Path + "报错了"
|
||||
if err := utils.ErrorToEmail(subject, str); err != nil {
|
||||
global.GVA_LOG.Error("ErrorToEmail Failed, err:", zap.Any("err", err))
|
||||
global.GVA_LOG.Error("ErrorToEmail Failed, err:", zap.Error(err))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@ func JWTAuth() gin.HandlerFunc {
|
||||
if global.GVA_CONFIG.System.UseMultipoint {
|
||||
err, RedisJwtToken := jwtService.GetRedisJWT(newClaims.Username)
|
||||
if err != nil {
|
||||
global.GVA_LOG.Error("get redis jwt failed", zap.Any("err", err))
|
||||
global.GVA_LOG.Error("get redis jwt failed", zap.Error(err))
|
||||
} else { // 当之前的取成功时才进行拉黑操作
|
||||
_ = jwtService.JsonInBlacklist(system.JwtBlacklist{Jwt: RedisJwtToken})
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ func OperationRecord() gin.HandlerFunc {
|
||||
var err error
|
||||
body, err = ioutil.ReadAll(c.Request.Body)
|
||||
if err != nil {
|
||||
global.GVA_LOG.Error("read body from request error:", zap.Any("err", err))
|
||||
global.GVA_LOG.Error("read body from request error:", zap.Error(err))
|
||||
} else {
|
||||
c.Request.Body = ioutil.NopCloser(bytes.NewBuffer(body))
|
||||
}
|
||||
@@ -69,7 +69,7 @@ func OperationRecord() gin.HandlerFunc {
|
||||
record.Resp = writer.body.String()
|
||||
|
||||
if err := operationRecordService.CreateSysOperationRecord(record); err != nil {
|
||||
global.GVA_LOG.Error("create operation record error:", zap.Any("err", err))
|
||||
global.GVA_LOG.Error("create operation record error:", zap.Error(err))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user