aboutsummaryrefslogtreecommitdiffstats
path: root/simulation
diff options
context:
space:
mode:
authorMission Liao <mission.liao@dexon.org>2018-11-14 11:23:56 +0800
committerJimmy Hu <jimmy.hu@dexon.org>2018-11-14 11:23:56 +0800
commite33261e6008dfba5b3401d0adc22a7da8649c9dc (patch)
treeff3b67832fd58dded6cc66d1c6b0542935e2808f /simulation
parentc3f1403eb4c3125ba08b28a40f77c299606529f9 (diff)
downloadtangerine-consensus-e33261e6008dfba5b3401d0adc22a7da8649c9dc.tar
tangerine-consensus-e33261e6008dfba5b3401d0adc22a7da8649c9dc.tar.gz
tangerine-consensus-e33261e6008dfba5b3401d0adc22a7da8649c9dc.tar.bz2
tangerine-consensus-e33261e6008dfba5b3401d0adc22a7da8649c9dc.tar.lz
tangerine-consensus-e33261e6008dfba5b3401d0adc22a7da8649c9dc.tar.xz
tangerine-consensus-e33261e6008dfba5b3401d0adc22a7da8649c9dc.tar.zst
tangerine-consensus-e33261e6008dfba5b3401d0adc22a7da8649c9dc.zip
core: sync logger with dex (#325)
Diffstat (limited to 'simulation')
-rw-r--r--simulation/node.go6
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.