From 7a04af762124f88ffe1ad33cb7825a5a56dd9f92 Mon Sep 17 00:00:00 2001 From: terence tsao Date: Fri, 26 Apr 2019 21:08:15 -0700 Subject: [PATCH] Use Withfields for Forked Block (#2394) * use with fields for forked block * spacing --- beacon-chain/sync/receive_block.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/beacon-chain/sync/receive_block.go b/beacon-chain/sync/receive_block.go index f5d93d0718a0..9821e70ce443 100644 --- a/beacon-chain/sync/receive_block.go +++ b/beacon-chain/sync/receive_block.go @@ -10,6 +10,7 @@ import ( "github.com/prysmaticlabs/prysm/shared/hashutil" "github.com/prysmaticlabs/prysm/shared/p2p" "github.com/prysmaticlabs/prysm/shared/params" + "github.com/sirupsen/logrus" "go.opencensus.io/trace" ) @@ -193,7 +194,10 @@ func (rs *RegularSync) validateAndProcessBlock( } } else { forkedBlock.Inc() - log.Warnf("Received Block from a Forked Chain with root %#x and slot %d", blockRoot, block.Slot) + log.WithFields(logrus.Fields{ + "slot": block.Slot, + "root": fmt.Sprintf("%#x", blockRoot)}, + ).Warn("Received Block from a forked chain") } sentBlocks.Inc()