调整日志

This commit is contained in:
Yun
2025-12-07 12:07:21 +08:00
parent ce2190e3de
commit d3786198df
+3 -3
View File
@@ -129,13 +129,13 @@ func ResponseCtx(ctx context.Context, w http.ResponseWriter, ops ...Option) {
}
}
bs, _ := json.Marshal(resp)
if !def.ignoreLog {
// 记录日志
def.logger.Info(ctx, "response:", resp)
def.logger.Info(ctx, "response:", string(bs))
}
bs, _ := json.Marshal(resp)
w.Header().Set("Content-Type", "application/json; charset=utf-8")
w.WriteHeader(200)
n, err := w.Write(bs)