mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-08-08 20:27:33 +08:00
Error code standardization
This commit is contained in:
parent
108685e8d0
commit
4acde81cc4
@ -30,7 +30,12 @@ func SetOperationID(ctx context.Context, operationID string) {
|
|||||||
|
|
||||||
func ShowLog(ctx context.Context) {
|
func ShowLog(ctx context.Context) {
|
||||||
t := ctx.Value(TraceLogKey).(*ApiInfo)
|
t := ctx.Value(TraceLogKey).(*ApiInfo)
|
||||||
log.Info(t.OperationID, "api: ", t.ApiName)
|
if ctx.Value(TraceLogKey).(*ApiInfo).GinCtx != nil {
|
||||||
|
log.Info(t.OperationID, "api: ", t.ApiName)
|
||||||
|
} else {
|
||||||
|
log.Info(t.OperationID, "rpc: ", t.ApiName)
|
||||||
|
}
|
||||||
|
|
||||||
for _, v := range *t.Funcs {
|
for _, v := range *t.Funcs {
|
||||||
if v.Err != nil {
|
if v.Err != nil {
|
||||||
log.Error(t.OperationID, "func: ", v.FuncName, " args: ", v.Args, v.Err.Error())
|
log.Error(t.OperationID, "func: ", v.FuncName, " args: ", v.Args, v.Err.Error())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user