add debug log

v4
vinllen 5 years ago
parent aee3c3fe84
commit 576dec59e9
  1. 29
      .circleci/config.yml
  2. 6
      src/pkg/rdb/loader.go
  3. 7
      src/pkg/rdb/reader.go

@ -1,29 +0,0 @@
# Golang CircleCI 2.0 configuration file
#
# Check https://circleci.com/docs/2.0/language-go/ for more details
version: 2
jobs:
build:
docker:
# specify the version
- image: circleci/golang:1.10
# Specify service dependencies here if necessary
# CircleCI maintains a library of pre-built images
# documented at https://circleci.com/docs/2.0/circleci-images/
# - image: circleci/postgres:9.4
#### TEMPLATE_NOTE: go expects specific checkout path representing url
#### expecting it in the form of
#### /go/src/github.com/circleci/go-tool
#### /go/src/bitbucket.org/circleci/go-tool
working_directory: /go/src/github.com/alibaba/RedisShake
steps:
- checkout
# specify any bash command here prefixed with `run: `
- run: export GOPATH=`pwd`
- run: go get -u github.com/kardianos/govendor
- run: cd src && ls && ls vendor
- run: govendor sync -v
- run: cd .. && sh build.sh

@ -196,9 +196,9 @@ func (l *Loader) NextBinEntry() (*BinEntry, error) {
} else {
key = l.lastEntry.Key
}
log.Debugf("l %p r %p", l, l.rdbReader)
log.Debugf("remainMember:", l.remainMember, " key:", string(key[:]), " type:", t)
log.Debugf("r.remainMember:", l.rdbReader.remainMember)
//log.Debugf("l %p r %p", l, l.rdbReader)
//log.Debug("remainMember:", l.remainMember, " key:", string(key[:]), " type:", t)
//log.Debug("r.remainMember:", l.rdbReader.remainMember)
val, err := l.readObjectValue(t, l)
if err != nil {
return nil, err

@ -13,8 +13,7 @@ import (
"strconv"
"pkg/libs/errors"
// "libs/log"
"pkg/libs/log"
)
var FromVersion int64 = 9
@ -145,12 +144,12 @@ func (r *rdbReader) readObjectValue(t byte, l *Loader) ([]byte, error) {
if n, err := r.ReadLength(); err != nil {
return nil, err
} else {
log.Debug("zset length: ", n)
// log.Debug("zset length: ", n)
for i := 0; i < int(n); i++ {
if _, err := r.ReadString(); err != nil {
return nil, err
}
log.Debug("zset read: ", i)
// log.Debug("zset read: ", i)
if t == RdbTypeZSet2 {
if _, err := r.ReadDouble(); err != nil {
return nil, err

Loading…
Cancel
Save