diff options
author | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2015-01-08 15:35:18 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2015-01-08 15:35:18 +0900 |
commit | 165aea923661333ea23ba06e9b4e0035a5911db3 (patch) | |
tree | 6bb12bba5b9d98ed8bcf010cdba37840456d890e /server/peer.go | |
parent | 8919e408e4a4a51c4f597c14670cedca6927da46 (diff) |
server: clean up logging messages
Use Fields.
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Diffstat (limited to 'server/peer.go')
-rw-r--r-- | server/peer.go | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/server/peer.go b/server/peer.go index 08a52530..ee3b2311 100644 --- a/server/peer.go +++ b/server/peer.go @@ -96,8 +96,11 @@ func NewPeer(g config.GlobalType, peer config.NeighborType, serverMsgCh chan *se } func (peer *Peer) handleBGPmessage(m *bgp.BGPMessage) { - j, _ := json.Marshal(m) - log.Debugf("received %v: %s", peer.peerConfig.NeighborAddress, j) + log.WithFields(log.Fields{ + "Topic": "Peer", + "Key": peer.peerConfig.NeighborAddress, + "data": m, + }).Debug("received") switch m.Header.Type { case bgp.BGP_MSG_OPEN: @@ -151,7 +154,11 @@ func (peer *Peer) sendMessages(msgs []*bgp.BGPMessage) { _, y := peer.capMap[bgp.BGP_CAP_FOUR_OCTET_AS_NUMBER] if !y { - log.Debug("update BGPUpdate for 2byte AS peer, ", peer.peerConfig.NeighborAddress.String()) + log.WithFields(log.Fields{ + "Topic": "Peer", + "Key": peer.peerConfig.NeighborAddress, + "data": m, + }).Debug("update for 2byte AS peer") table.UpdatePathAttrs2ByteAs(m.Body.(*bgp.BGPUpdate)) } |