add debug log of sending and receiving command2

v4
vinllen 6 years ago
parent fdb5ceb19c
commit bad7d42bb6
  1. 3
      src/redis-shake/sync.go

@ -24,6 +24,7 @@ import (
"redis-shake/base" "redis-shake/base"
"redis-shake/heartbeat" "redis-shake/heartbeat"
"redis-shake/metric" "redis-shake/metric"
"unsafe"
) )
type delayNode struct { type delayNode struct {
@ -478,7 +479,7 @@ func (cmd *CmdSync) SyncCommand(reader *bufio.Reader, target, auth_type, passwd
if conf.Options.LogLevel == utils.LogLevelAll { if conf.Options.LogLevel == utils.LogLevelAll {
strArgv := make([]string, len(argv)) strArgv := make([]string, len(argv))
for i, ele := range argv { for i, ele := range argv {
strArgv[i] = string(ele) strArgv[i] = *(*string)(unsafe.Pointer(&ele))
} }
log.Debugf("send command: [%s %v]", scmd, strArgv) log.Debugf("send command: [%s %v]", scmd, strArgv)
} }

Loading…
Cancel
Save