aboutsummaryrefslogtreecommitdiffstats
path: root/simulation/node.go
diff options
context:
space:
mode:
authorJimmy Hu <jimmy.hu@dexon.org>2018-11-29 15:57:23 +0800
committerGitHub <noreply@github.com>2018-11-29 15:57:23 +0800
commit9fbc3a068b228963e6f077e486dc962bf77714c1 (patch)
treef50a7f60c8cbe1a2c9101017d57724eb3bf686cf /simulation/node.go
parentdaf3bab93c323b173345811adc9a334dad4a7094 (diff)
downloaddexon-consensus-9fbc3a068b228963e6f077e486dc962bf77714c1.tar
dexon-consensus-9fbc3a068b228963e6f077e486dc962bf77714c1.tar.gz
dexon-consensus-9fbc3a068b228963e6f077e486dc962bf77714c1.tar.bz2
dexon-consensus-9fbc3a068b228963e6f077e486dc962bf77714c1.tar.lz
dexon-consensus-9fbc3a068b228963e6f077e486dc962bf77714c1.tar.xz
dexon-consensus-9fbc3a068b228963e6f077e486dc962bf77714c1.tar.zst
dexon-consensus-9fbc3a068b228963e6f077e486dc962bf77714c1.zip
simulation: -log to dump log to file as well (#348)
Diffstat (limited to 'simulation/node.go')
-rw-r--r--simulation/node.go7
1 files changed, 2 insertions, 5 deletions
diff --git a/simulation/node.go b/simulation/node.go
index 8c37f65..cea0035 100644
--- a/simulation/node.go
+++ b/simulation/node.go
@@ -20,7 +20,6 @@ package simulation
import (
"encoding/json"
"fmt"
- "os"
"time"
"github.com/dexon-foundation/dexon-consensus/common"
@@ -30,7 +29,6 @@ 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
@@ -126,7 +124,8 @@ func (n *node) GetID() types.NodeID {
}
// run starts the node.
-func (n *node) run(serverEndpoint interface{}, dMoment time.Time) {
+func (n *node) run(
+ serverEndpoint interface{}, dMoment time.Time, logger common.Logger) {
// Run network.
if err := n.netModule.Setup(serverEndpoint); err != nil {
panic(err)
@@ -146,8 +145,6 @@ 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,