Skip to content

Commit

Permalink
fix: log kv do not print origin pointer. (#120)
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
FGadvancer authored Aug 1, 2024
1 parent 19270af commit 22afab0
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions log/zap.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,11 @@ import (
rotatelogs "github.com/openimsdk/tools/log/file-rotatelogs"
"github.com/openimsdk/tools/utils/stringutil"

"github.com/openimsdk/protocol/constant"
"github.com/openimsdk/tools/mcontext"
"go.uber.org/zap"
"go.uber.org/zap/zapcore"

"github.com/openimsdk/protocol/constant"
"github.com/openimsdk/tools/mcontext"
)

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

Expand Down

0 comments on commit 22afab0

Please sign in to comment.