From 13e9aefa1d7ec92600d46a004d5f38a4ff95ac7e Mon Sep 17 00:00:00 2001 From: FUJITA Tomonori Date: Mon, 22 Dec 2014 05:19:07 -0800 Subject: add --log-json command line option During development, it's easy to parse a plain format by human. Signed-off-by: FUJITA Tomonori --- server/fsm.go | 2 +- server/server.go | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'server') diff --git a/server/fsm.go b/server/fsm.go index 9dab59e2..62c2495b 100644 --- a/server/fsm.go +++ b/server/fsm.go @@ -96,7 +96,7 @@ func (fsm *FSM) StateChanged() chan int { } func (fsm *FSM) StateChange(nextState int) { - log.Debugf("Peer (%v) state changed from %v to %v", fsm.peerConfig.NeighborAddress, nextState, fsm.state) + log.Debugf("Peer (%v) state changed from %v to %v", fsm.peerConfig.NeighborAddress, fsm.state, nextState) fsm.state = nextState } diff --git a/server/server.go b/server/server.go index 01daa23a..f3ed0092 100644 --- a/server/server.go +++ b/server/server.go @@ -93,10 +93,10 @@ func (server *BgpServer) Serve() { remoteAddr := strings.Split(conn.RemoteAddr().String(), ":")[0] peer, found := server.peerMap[remoteAddr] if found { - log.Info("accepted a new passive connection for", remoteAddr) + log.Info("accepted a new passive connection from ", remoteAddr) peer.PassConn(conn) } else { - log.Info("can't find configuration for a new passive connection", remoteAddr) + log.Info("can't find configuration for a new passive connection from ", remoteAddr) conn.Close() } case peer := <-server.addedPeerCh: @@ -109,11 +109,11 @@ func (server *BgpServer) Serve() { SetTcpMD5SigSockopts(int(f.Fd()), addr, "") p, found := server.peerMap[addr] if found { - log.Info("Delete a peer configuration for", addr) + log.Info("Delete a peer configuration for ", addr) p.Stop() delete(server.peerMap, addr) } else { - log.Info("Can't delete a peer configuration for", addr) + log.Info("Can't delete a peer configuration for ", addr) } case restReq := <-server.RestReqCh: server.handleRest(restReq) -- cgit v1.2.3