From a5874d6912e2286fa5af5dc452e3d99ebc38c7a5 Mon Sep 17 00:00:00 2001 From: FUJITA Tomonori Date: Mon, 22 Dec 2014 04:58:46 -0800 Subject: server: use logger instead of stdout Signed-off-by: FUJITA Tomonori --- server/peer.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'server/peer.go') diff --git a/server/peer.go b/server/peer.go index 3c852ccf..a28e94b6 100644 --- a/server/peer.go +++ b/server/peer.go @@ -17,7 +17,7 @@ package server import ( "encoding/json" - "fmt" + log "github.com/Sirupsen/logrus" "github.com/osrg/gobgp/config" "github.com/osrg/gobgp/packet" "github.com/osrg/gobgp/table" @@ -62,7 +62,7 @@ func NewPeer(g config.GlobalType, peer config.NeighborType, outEventCh chan *mes func (peer *Peer) handleBGPmessage(m *bgp.BGPMessage) { j, _ := json.Marshal(m) - fmt.Println(string(j)) + log.Info(string(j)) // TODO: update state here if m.Header.Type != bgp.BGP_MSG_UPDATE { @@ -136,8 +136,8 @@ func (peer *Peer) loop() error { case nextState := <-peer.fsm.StateChanged(): // waits for all goroutines created for the current state h.Wait() - oldState := peer.fsm.state - peer.fsm.state = nextState + oldState := peer.state + peer.state = nextState peer.fsm.StateChange(nextState) sameState = false // TODO: check peer's rf -- cgit v1.2.3