summaryrefslogtreecommitdiffhomepage
path: root/server/peer.go
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2014-12-22 04:58:46 -0800
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2014-12-22 04:58:46 -0800
commita5874d6912e2286fa5af5dc452e3d99ebc38c7a5 (patch)
tree77724caffc72447f6b4b0d89de643fa980bbfcfa /server/peer.go
parent6ecf5e15ceda5e8535727d16a3d04e35cb7f51d0 (diff)
server: use logger instead of stdout
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Diffstat (limited to 'server/peer.go')
-rw-r--r--server/peer.go8
1 files changed, 4 insertions, 4 deletions
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