Improve logs

License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
This commit is contained in:
Jakub Sztandera 2019-10-05 17:59:35 +02:00
parent 1ea23da756
commit 9e74b19da0
No known key found for this signature in database
GPG Key ID: 9A9AF56F8B3879BA
3 changed files with 4 additions and 2 deletions

View File

@ -277,7 +277,7 @@ func (bs *BlockSync) GetBlocks(ctx context.Context, tipset []cid.Cid, count int)
} }
oerr = bs.processStatus(req, res) oerr = bs.processStatus(req, res)
if oerr != nil { if oerr != nil {
log.Warnf("BlockSync peer %s response was an error: %s", peers[p].String(), err) log.Warnf("BlockSync peer %s response was an error: %s", peers[p].String(), oerr)
} }
} }
return nil, xerrors.Errorf("GetBlocks failed with all peers: %w", oerr) return nil, xerrors.Errorf("GetBlocks failed with all peers: %w", oerr)

View File

@ -10,6 +10,7 @@ import (
"github.com/filecoin-project/go-lotus/build" "github.com/filecoin-project/go-lotus/build"
"github.com/filecoin-project/go-lotus/chain/address" "github.com/filecoin-project/go-lotus/chain/address"
"github.com/filecoin-project/go-lotus/chain/state" "github.com/filecoin-project/go-lotus/chain/state"
"go.uber.org/zap"
amt "github.com/filecoin-project/go-amt-ipld" amt "github.com/filecoin-project/go-amt-ipld"
"github.com/filecoin-project/go-lotus/chain/types" "github.com/filecoin-project/go-lotus/chain/types"
@ -757,7 +758,7 @@ func (cs *ChainStore) GetRandomness(ctx context.Context, blks []cid.Cid, tickets
} }
lt := int64(len(tickets)) lt := int64(len(tickets))
if lb < lt { if lb < lt {
log.Warn("self sampling randomness. this should be extremely rare, if you see this often it may be a bug") log.Desugar().Warn("self sampling randomness. this should be extremely rare, if you see this often it may be a bug", zap.Stack("call-stack"))
t := tickets[lt-(1+lb)] t := tickets[lt-(1+lb)]

1
go.mod
View File

@ -76,6 +76,7 @@ require (
go.uber.org/dig v1.7.0 // indirect go.uber.org/dig v1.7.0 // indirect
go.uber.org/fx v1.9.0 go.uber.org/fx v1.9.0
go.uber.org/goleak v0.10.0 // indirect go.uber.org/goleak v0.10.0 // indirect
go.uber.org/zap v1.10.0
go4.org v0.0.0-20190313082347-94abd6928b1d // indirect go4.org v0.0.0-20190313082347-94abd6928b1d // indirect
golang.org/x/crypto v0.0.0-20190829043050-9756ffdc2472 // indirect golang.org/x/crypto v0.0.0-20190829043050-9756ffdc2472 // indirect
golang.org/x/sys v0.0.0-20190904154756-749cb33beabd // indirect golang.org/x/sys v0.0.0-20190904154756-749cb33beabd // indirect