From 8797a5c6089868678c1e9b4166de6a6a3b2dcb13 Mon Sep 17 00:00:00 2001 From: Androlo <andreas@erisindustries.com> Date: Sun, 23 Aug 2015 17:55:28 +0100 Subject: [PATCH] remove some logging --- .../_workspace/src/github.com/tendermint/tendermint/vm/vm.go | 1 - erisdb/json_service.go | 5 ++--- erisdb/methods.go | 5 ----- erisdb/pipe/transactor.go | 5 +++-- erisdb/serve.go | 2 +- erisdb/wsService.go | 4 ++-- 6 files changed, 8 insertions(+), 14 deletions(-) diff --git a/Godeps/_workspace/src/github.com/tendermint/tendermint/vm/vm.go b/Godeps/_workspace/src/github.com/tendermint/tendermint/vm/vm.go index 78f35c05..9eb27570 100644 --- a/Godeps/_workspace/src/github.com/tendermint/tendermint/vm/vm.go +++ b/Godeps/_workspace/src/github.com/tendermint/tendermint/vm/vm.go @@ -703,7 +703,6 @@ func (vm *VM) call(caller, callee *Account, code, input []byte, value int64, gas vm.appState.AddLog(log) if vm.evc != nil { eventId := types.EventStringLogEvent(callee.Address.Postfix(20)) - fmt.Printf("eventId: %s\n", eventId) vm.evc.FireEvent(eventId, log) } // Using sol-log for this as well since 'log' will print garbage. diff --git a/erisdb/json_service.go b/erisdb/json_service.go index d80255f9..c08eec29 100644 --- a/erisdb/json_service.go +++ b/erisdb/json_service.go @@ -2,7 +2,6 @@ package erisdb import ( "encoding/json" - "fmt" "github.com/eris-ltd/eris-db/Godeps/_workspace/src/github.com/gin-gonic/gin" ep "github.com/eris-ltd/eris-db/erisdb/pipe" rpc "github.com/eris-ltd/eris-db/rpc" @@ -117,10 +116,10 @@ func (this *ErisDbJsonService) writeError(msg, id string, code int, w http.Respo // Helper for writing responses. func (this *ErisDbJsonService) writeResponse(id string, result interface{}, w http.ResponseWriter) { - fmt.Printf("Result: %v\n", result) + log.Debug("Result: %v\n", result) response := rpc.NewRPCResponse(id, result) err := this.codec.Encode(response, w) - fmt.Printf("Response: %v\n", response) + log.Debug("Response: %v\n", response) if err != nil { this.writeError("Internal error: "+err.Error(), id, rpc.INTERNAL_ERROR, w) return diff --git a/erisdb/methods.go b/erisdb/methods.go index 13fe8744..7a27628d 100644 --- a/erisdb/methods.go +++ b/erisdb/methods.go @@ -3,7 +3,6 @@ package erisdb import ( "crypto/rand" "encoding/hex" - "fmt" "github.com/eris-ltd/eris-db/Godeps/_workspace/src/github.com/tendermint/tendermint/types" ep "github.com/eris-ltd/eris-db/erisdb/pipe" rpc "github.com/eris-ltd/eris-db/rpc" @@ -151,12 +150,10 @@ func (this *ErisDbMethods) Account(request *rpc.RPCRequest, requester interface{ func (this *ErisDbMethods) Accounts(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error) { param := &AccountsParam{} - fmt.Printf("ACCOUNT LIST REQUEST: %v\n", request) err := this.codec.DecodeBytes(param, request.Params) if err != nil { return nil, rpc.INVALID_PARAMS, err } - fmt.Printf("PARAMS: %v\n", param) list, errC := this.pipe.Accounts().Accounts(param.Filters) if errC != nil { return nil, rpc.INTERNAL_ERROR, errC @@ -473,12 +470,10 @@ func (this *ErisDbMethods) NameRegEntry(request *rpc.RPCRequest, requester inter func (this *ErisDbMethods) NameRegEntries(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error) { param := &FilterListParam{} - fmt.Printf("ACCOUNT LIST REQUEST: %v\n", request) err := this.codec.DecodeBytes(param, request.Params) if err != nil { return nil, rpc.INVALID_PARAMS, err } - fmt.Printf("PARAMS: %v\n", param) list, errC := this.pipe.NameReg().Entries(param.Filters) if errC != nil { return nil, rpc.INTERNAL_ERROR, errC diff --git a/erisdb/pipe/transactor.go b/erisdb/pipe/transactor.go index b95f87ba..a0cfb8b4 100644 --- a/erisdb/pipe/transactor.go +++ b/erisdb/pipe/transactor.go @@ -135,7 +135,6 @@ func (this *transactor) Transact(privKey, address, data []byte, gasLimit, fee in } pk := &[64]byte{} copy(pk[:], privKey) - fmt.Printf("PK BYTES FROM TRANSACT: %x\n", pk) this.txMtx.Lock() defer this.txMtx.Unlock() pa := account.GenPrivAccountFromPrivKeyBytes(pk) @@ -147,6 +146,7 @@ func (this *transactor) Transact(privKey, address, data []byte, gasLimit, fee in } else { sequence = acc.Sequence + 1 } + // fmt.Printf("Sequence %d\n", sequence) txInput := &types.TxInput{ Address: pa.Address, Amount: 1, @@ -217,7 +217,8 @@ func (this *transactor) TransactNameReg(privKey []byte, name, data string, amoun } pk := &[64]byte{} copy(pk[:], privKey) - fmt.Printf("PK BYTES FROM TRANSACT NAMEREG: %x\n", pk) + this.txMtx.Lock() + defer this.txMtx.Unlock() pa := account.GenPrivAccountFromPrivKeyBytes(pk) cache := this.mempoolReactor.Mempool.GetCache() acc := cache.GetAccount(pa.Address) diff --git a/erisdb/serve.go b/erisdb/serve.go index 11343d14..2f9bcd60 100644 --- a/erisdb/serve.go +++ b/erisdb/serve.go @@ -14,7 +14,7 @@ import ( "path" ) -const ERISDB_VERSION = "0.11.4" +const ERISDB_VERSION = "0.11.5" const TENDERMINT_VERSION = "0.5.0" var log = log15.New("module", "eris/erisdb_server") diff --git a/erisdb/wsService.go b/erisdb/wsService.go index 258cccea..cd19e36b 100644 --- a/erisdb/wsService.go +++ b/erisdb/wsService.go @@ -30,7 +30,7 @@ func NewErisDbWsService(codec rpc.Codec, pipe ep.Pipe) server.WebSocketService { // Process a request. func (this *ErisDbWsService) Process(msg []byte, session *server.WSSession) { - fmt.Printf("REQUEST: %s\n", string(msg)) + log.Debug("REQUEST: %s\n", string(msg)) // Create new request object and unmarshal. req := &rpc.RPCRequest{} errU := json.Unmarshal(msg, req) @@ -76,7 +76,7 @@ func (this *ErisDbWsService) writeError(msg, id string, code int, session *serve func (this *ErisDbWsService) writeResponse(id string, result interface{}, session *server.WSSession) { response := rpc.NewRPCResponse(id, result) bts, err := this.codec.EncodeBytes(response) - fmt.Printf("Response: %v\n", response) + log.Debug("RESPONSE: %v\n", response) if err != nil { this.writeError("Internal error: "+err.Error(), id, rpc.INTERNAL_ERROR, session) return -- GitLab