mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-05-10 04:59:01 +08:00
Merge remote-tracking branch 'origin/errcode' into errcode
This commit is contained in:
commit
b57616cb29
@ -4,7 +4,6 @@ import (
|
|||||||
"Open_IM/pkg/common/constant"
|
"Open_IM/pkg/common/constant"
|
||||||
"Open_IM/pkg/common/log"
|
"Open_IM/pkg/common/log"
|
||||||
"context"
|
"context"
|
||||||
"encoding/json"
|
|
||||||
"google.golang.org/grpc/status"
|
"google.golang.org/grpc/status"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
@ -124,9 +123,20 @@ type FuncInfo struct {
|
|||||||
|
|
||||||
type Args map[string]interface{}
|
type Args map[string]interface{}
|
||||||
|
|
||||||
func (a *Args) String() string {
|
func (a Args) String() string {
|
||||||
bytes, _ := json.Marshal(a)
|
var s string
|
||||||
return string(bytes)
|
var hasElement bool
|
||||||
|
for k, v := range a {
|
||||||
|
if !hasElement {
|
||||||
|
s += "{"
|
||||||
|
hasElement = true
|
||||||
|
}
|
||||||
|
s += fmt.Sprintf("%s: %v", k, v)
|
||||||
|
}
|
||||||
|
if hasElement {
|
||||||
|
s += "}"
|
||||||
|
}
|
||||||
|
return s
|
||||||
}
|
}
|
||||||
|
|
||||||
func SetContextInfo(ctx context.Context, funcName string, err error, args ...interface{}) {
|
func SetContextInfo(ctx context.Context, funcName string, err error, args ...interface{}) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user