From 576dec59e9da9c34d62061e542f8f300083cb831 Mon Sep 17 00:00:00 2001 From: vinllen Date: Tue, 27 Aug 2019 19:03:36 +0800 Subject: [PATCH] add debug log --- .circleci/config.yml | 29 ----------------------------- src/pkg/rdb/loader.go | 6 +++--- src/pkg/rdb/reader.go | 7 +++---- 3 files changed, 6 insertions(+), 36 deletions(-) delete mode 100644 .circleci/config.yml diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index d926c18..0000000 --- a/.circleci/config.yml +++ /dev/null @@ -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 diff --git a/src/pkg/rdb/loader.go b/src/pkg/rdb/loader.go index 28760f8..a591ac0 100644 --- a/src/pkg/rdb/loader.go +++ b/src/pkg/rdb/loader.go @@ -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 diff --git a/src/pkg/rdb/reader.go b/src/pkg/rdb/reader.go index 7fe4eea..a4ab75a 100644 --- a/src/pkg/rdb/reader.go +++ b/src/pkg/rdb/reader.go @@ -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