feat(log): 全面重构日志系统,支持日志级别、去除ANSI乱码并抑制高频轮询
This commit is contained in:
@@ -151,7 +151,7 @@ func OpenAuth(cfg OpenAuthConfig) gin.HandlerFunc {
|
||||
c.Set(openlog.CtxAPIKey, appKey)
|
||||
_ = cfg.DB.Model(&model.APIClient{}).Where("id = ?", client.ID).Update("last_used_at", now).Error
|
||||
|
||||
openlog.Info(c, "open_auth ok app_key=%s merchant_id=%d method=%s path=%s body_size=%d",
|
||||
openlog.Debug(c, "open_auth ok app_key=%s merchant_id=%d method=%s path=%s body_size=%d",
|
||||
openlog.MaskKey(appKey), client.MerchantID, method, path, len(bodyBytes))
|
||||
c.Next()
|
||||
}
|
||||
|
||||
@@ -121,7 +121,7 @@ func SourceOpenAuth(cfg SourceOpenAuthConfig) gin.HandlerFunc {
|
||||
return
|
||||
}
|
||||
|
||||
openlog.Info(c, "source_open_auth ok method=%s path=%s body_size=%d",
|
||||
openlog.Debug(c, "source_open_auth ok method=%s path=%s body_size=%d",
|
||||
c.Request.Method, c.Request.URL.Path, len(bodyBytes))
|
||||
c.Next()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user