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 /simulation | |
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 'simulation')
-rw-r--r-- | simulation/node.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/simulation/node.go b/simulation/node.go index ef54ffc..8c37f65 100644 --- a/simulation/node.go +++ b/simulation/node.go @@ -20,6 +20,7 @@ package simulation import ( "encoding/json" "fmt" + "os" "time" "github.com/dexon-foundation/dexon-consensus/common" @@ -29,6 +30,7 @@ import ( "github.com/dexon-foundation/dexon-consensus/core/test" "github.com/dexon-foundation/dexon-consensus/core/types" "github.com/dexon-foundation/dexon-consensus/simulation/config" + "github.com/dexon-foundation/dexon/log" ) type infoStatus string @@ -144,6 +146,8 @@ func (n *node) run(serverEndpoint interface{}, dMoment time.Time) { // Setup of governance is ready, can be switched to remote mode. n.gov.SwitchToRemoteMode(n.netModule) // Setup Consensus. + logger := log.New() + logger.SetHandler(log.StreamHandler(os.Stderr, log.LogfmtFormat())) n.consensus = core.NewConsensus( dMoment, n.app, @@ -151,7 +155,7 @@ func (n *node) run(serverEndpoint interface{}, dMoment time.Time) { n.db, n.netModule, n.prvKey, - &common.SimpleLogger{}) + logger) go n.consensus.Run(&types.Block{}) // Blocks forever. |