diff options
author | Mission Liao <mission.liao@dexon.org> | 2018-11-14 11:23:56 +0800 |
---|---|---|
committer | Jimmy Hu <jimmy.hu@dexon.org> | 2018-11-14 11:23:56 +0800 |
commit | e33261e6008dfba5b3401d0adc22a7da8649c9dc (patch) | |
tree | ff3b67832fd58dded6cc66d1c6b0542935e2808f /core | |
parent | c3f1403eb4c3125ba08b28a40f77c299606529f9 (diff) | |
download | dexon-consensus-e33261e6008dfba5b3401d0adc22a7da8649c9dc.tar dexon-consensus-e33261e6008dfba5b3401d0adc22a7da8649c9dc.tar.gz dexon-consensus-e33261e6008dfba5b3401d0adc22a7da8649c9dc.tar.bz2 dexon-consensus-e33261e6008dfba5b3401d0adc22a7da8649c9dc.tar.lz dexon-consensus-e33261e6008dfba5b3401d0adc22a7da8649c9dc.tar.xz dexon-consensus-e33261e6008dfba5b3401d0adc22a7da8649c9dc.tar.zst dexon-consensus-e33261e6008dfba5b3401d0adc22a7da8649c9dc.zip |
core: sync logger with dex (#325)
Diffstat (limited to 'core')
-rw-r--r-- | core/types/block-randomness.go | 4 | ||||
-rw-r--r-- | core/types/block.go | 2 | ||||
-rw-r--r-- | core/types/dkg/dkg.go | 8 | ||||
-rw-r--r-- | core/types/position.go | 3 | ||||
-rw-r--r-- | core/types/vote.go | 3 |
5 files changed, 11 insertions, 9 deletions
diff --git a/core/types/block-randomness.go b/core/types/block-randomness.go index 1eaa3e3..6df245b 100644 --- a/core/types/block-randomness.go +++ b/core/types/block-randomness.go @@ -31,8 +31,8 @@ type AgreementResult struct { } func (r *AgreementResult) String() string { - return fmt.Sprintf( - "agreementResult[%s:%s]", r.BlockHash, &r.Position) + return fmt.Sprintf("agreementResult{Hash:%s %s}", + r.BlockHash.String()[:6], &r.Position) } // BlockRandomnessResult describes a block randomness result diff --git a/core/types/block.go b/core/types/block.go index b24e1f7..f42b702 100644 --- a/core/types/block.go +++ b/core/types/block.go @@ -221,7 +221,7 @@ func (b *Block) DecodeRLP(s *rlp.Stream) error { } func (b *Block) String() string { - return fmt.Sprintf("Block(%v:%s)", b.Hash.String()[:6], &b.Position) + return fmt.Sprintf("Block{Hash:%v %s}", b.Hash.String()[:6], &b.Position) } // Clone returns a deep copy of a block. diff --git a/core/types/dkg/dkg.go b/core/types/dkg/dkg.go index 4053c5a..cecc4f1 100644 --- a/core/types/dkg/dkg.go +++ b/core/types/dkg/dkg.go @@ -61,7 +61,7 @@ type MasterPublicKey struct { } func (d *MasterPublicKey) String() string { - return fmt.Sprintf("MasterPublicKey[%s:%d]", + return fmt.Sprintf("MasterPublicKey{KP:%s Round:%d}", d.ProposerID.String()[:6], d.Round) } @@ -141,11 +141,11 @@ type Complaint struct { func (c *Complaint) String() string { if c.IsNack() { - return fmt.Sprintf("DKGNackComplaint[%s:%d]%s", + return fmt.Sprintf("DKGNackComplaint{CP:%s Round:%d PSP:%s}", c.ProposerID.String()[:6], c.Round, c.PrivateShare.ProposerID.String()[:6]) } - return fmt.Sprintf("Complaint[%s:%d]%v", + return fmt.Sprintf("DKGComplaint{CP:%s Round:%d PrivateShare:%v}", c.ProposerID.String()[:6], c.Round, c.PrivateShare) } @@ -175,7 +175,7 @@ type Finalize struct { } func (final *Finalize) String() string { - return fmt.Sprintf("DKGFinal[%s:%d]", + return fmt.Sprintf("DKGFinal{FP:%s Round:%d}", final.ProposerID.String()[:6], final.Round) } diff --git a/core/types/position.go b/core/types/position.go index 1fc7e6b..8822f6e 100644 --- a/core/types/position.go +++ b/core/types/position.go @@ -29,7 +29,8 @@ type Position struct { } func (pos *Position) String() string { - return fmt.Sprintf("[%d:%d:%d]", pos.Round, pos.ChainID, pos.Height) + return fmt.Sprintf("Position{Round:%d Chain:%d Height:%d}", + pos.Round, pos.ChainID, pos.Height) } // Equal checks if two positions are equal, it panics when their chainIDs diff --git a/core/types/vote.go b/core/types/vote.go index 12c3af8..7601542 100644 --- a/core/types/vote.go +++ b/core/types/vote.go @@ -52,7 +52,8 @@ type Vote struct { } func (v *Vote) String() string { - return fmt.Sprintf("Vote[%s:%s](%d:%d):%s", v.ProposerID.String()[:6], + return fmt.Sprintf("Vote{BP:%s %s Period:%d Type:%d Hash:%s}", + v.ProposerID.String()[:6], &v.Position, v.Period, v.Type, v.BlockHash.String()[:6]) } |