mirror of
https://github.com/zeromicro/go-zero.git
synced 2026-05-11 00:40:00 +08:00
chore: use logc instead of logx if possible (#4610)
This commit is contained in:
@@ -9,6 +9,7 @@ import (
|
||||
"net/http"
|
||||
"sync"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logc"
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
"github.com/zeromicro/go-zero/rest/internal/errcode"
|
||||
"github.com/zeromicro/go-zero/rest/internal/header"
|
||||
@@ -119,7 +120,7 @@ func WriteJson(w http.ResponseWriter, code int, v any) {
|
||||
// WriteJsonCtx writes v as json string into w with code.
|
||||
func WriteJsonCtx(ctx context.Context, w http.ResponseWriter, code int, v any) {
|
||||
if err := doWriteJson(w, code, v); err != nil {
|
||||
logx.WithContext(ctx).Error(err)
|
||||
logc.Error(ctx, err)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user