Skip to content

Commit 9d1d7d4

Browse files
authored
Improve GPBFT Logging (#566)
* Update round after logging Otherwise, it looks like we were in the last phase of the wrong round. * Fix logging skip
1 parent a5e96fc commit 9d1d7d4

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

gpbft/gpbft.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -754,8 +754,8 @@ func (i *instance) getRound(r uint64) *roundState {
754754
}
755755

756756
func (i *instance) beginNextRound() {
757+
i.log("moving to round %d with %s", i.round+1, i.proposal.String())
757758
i.round += 1
758-
i.log("moving to round %d with %s", i.round, i.proposal.String())
759759
metrics.currentRound.Record(context.TODO(), int64(i.round))
760760

761761
prevRound := i.getRound(i.round - 1)

logging.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import (
66
)
77

88
var log = logging.Logger("f3")
9-
var tracer gpbft.Tracer = (*gpbftTracer)(logging.WithSkip(logging.Logger("f3/gpbft"), 1))
9+
var tracer gpbft.Tracer = (*gpbftTracer)(logging.WithSkip(logging.Logger("f3/gpbft"), 2))
1010

1111
// Tracer used by GPBFT, backed by a Zap logger.
1212
type gpbftTracer logging.ZapEventLogger

0 commit comments

Comments
 (0)