OSDN Git Service

fix log output
authorwz <mars@bytom.io>
Mon, 7 May 2018 07:47:20 +0000 (15:47 +0800)
committerYahtoo Ma <yahtoo.ma@gmail.com>
Tue, 8 May 2018 07:32:53 +0000 (15:32 +0800)
cmd/bytomd/commands/run_node.go
netsync/handle.go

index df0d378..f57ef97 100644 (file)
@@ -45,7 +45,7 @@ func runNode(cmd *cobra.Command, args []string) error {
        if _, err := n.Start(); err != nil {
                return fmt.Errorf("Failed to start node: %v", err)
        } else {
-               log.WithField("nodeInfo", n.SyncManager().Switch().NodeInfo()).Info("Started node")
+               log.Info("Started node")
        }
 
        // Trap signal, run forever.
index 0494a38..462b9b3 100644 (file)
@@ -9,13 +9,14 @@ import (
        cmn "github.com/tendermint/tmlibs/common"
        dbm "github.com/tendermint/tmlibs/db"
 
+       "net"
+       "time"
+
        cfg "github.com/bytom/config"
        "github.com/bytom/p2p"
        core "github.com/bytom/protocol"
        "github.com/bytom/protocol/bc"
        "github.com/bytom/version"
-       "net"
-       "time"
 )
 
 //SyncManager Sync Manager is responsible for the business layer information synchronization
@@ -138,7 +139,7 @@ func (sm *SyncManager) netStart() error {
                conn, err := net.DialTimeout("tcp", sm.NodeInfo().ListenAddr, 3*time.Second)
 
                if err != nil && conn == nil {
-                       log.Info("Could not open listen port")
+                       log.Error("Could not open listen port")
                }
 
                if err == nil && conn != nil {
@@ -156,7 +157,7 @@ func (sm *SyncManager) netStart() error {
                        return err
                }
        }
-
+       log.WithField("nodeInfo", sm.sw.NodeInfo()).Info("net start")
        return nil
 }