Skip to content

Commit 22afab0

Browse files
authored
fix: log kv do not print origin pointer. (#120)
* optimization: slice sub. * fix: rpc logger add more detail info. * feat: add msg gateway error. * refactor: separate functions with error containing message and error with only stack trace. * feat: add stdout and stderr info. * feat: add strings and sql log. * feat: add copy function. * feat: add strings function. * feat: add strings function. * feat: add strings function. * feat: print version filed. * fix: version update. * refactor: change go mod name. * refactor: change go mod name. * refactor: change go mod name. * refactor: log change. * refactor: log change. * refactor: log change. * fix: log kv do not print origin pointer.
1 parent 19270af commit 22afab0

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

Diff for: log/zap.go

+3-4
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,11 @@ import (
2424
rotatelogs "github.com/openimsdk/tools/log/file-rotatelogs"
2525
"github.com/openimsdk/tools/utils/stringutil"
2626

27-
"github.com/openimsdk/protocol/constant"
28-
"github.com/openimsdk/tools/mcontext"
2927
"go.uber.org/zap"
3028
"go.uber.org/zap/zapcore"
29+
30+
"github.com/openimsdk/protocol/constant"
31+
"github.com/openimsdk/tools/mcontext"
3132
)
3233

3334
type LogFormatter interface {
@@ -393,8 +394,6 @@ func (l *ZapLogger) kvAppend(ctx context.Context, keysAndValues []any) []any {
393394
for i := 1; i < len(keysAndValues); i += 2 {
394395
if s, ok := keysAndValues[i].(interface{ String() string }); ok {
395396
keysAndValues[i] = s.String()
396-
} else {
397-
keysAndValues[i] = fmt.Sprintf("%+v", keysAndValues[i])
398397
}
399398
}
400399

0 commit comments

Comments
 (0)