diff options
author | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2014-12-22 05:19:07 -0800 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2014-12-22 05:19:07 -0800 |
commit | 13e9aefa1d7ec92600d46a004d5f38a4ff95ac7e (patch) | |
tree | b88dd27679b4a891bd6218498123811ab0d85596 /server | |
parent | a5874d6912e2286fa5af5dc452e3d99ebc38c7a5 (diff) |
add --log-json command line option
During development, it's easy to parse a plain format by human.
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Diffstat (limited to 'server')
-rw-r--r-- | server/fsm.go | 2 | ||||
-rw-r--r-- | server/server.go | 8 |
2 files changed, 5 insertions, 5 deletions
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) |