diff options
author | dsp <dsp@2f30.org> | 2016-07-30 14:16:48 +0000 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2016-07-30 12:17:37 +0900 |
commit | c4fe45902e736a858c4870bcab01c9143551f696 (patch) | |
tree | cbc45786d584fd98c1fb55851f2200bea938c909 /openswitch/openswitch.go | |
parent | bb15c18402ffcb5beb60aa61cfdc57577633f234 (diff) |
all logging is done with log.WithFields
Signed-off-by: dsp <dsp@2f30.org>
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Diffstat (limited to 'openswitch/openswitch.go')
-rw-r--r-- | openswitch/openswitch.go | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/openswitch/openswitch.go b/openswitch/openswitch.go index 3d8ca9ff..0b405a9f 100644 --- a/openswitch/openswitch.go +++ b/openswitch/openswitch.go @@ -169,7 +169,9 @@ func parseRouteToGobgp(route ovsdb.RowUpdate, nexthops map[string]ovsdb.Row) (*a nexthop = "::" } if len(nh) == 0 { - log.Debug("nexthop addres does not exist") + log.WithFields(log.Fields{ + "Topic": "openswitch", + }).Debug("nexthop addres does not exist") } else if len(nh) == 1 { if net.ParseIP(nh[0].(string)) == nil { return nil, isWithdraw, isFromGobgp, fmt.Errorf("invalid nexthop address") @@ -286,7 +288,10 @@ func (m *OpsManager) handleVrfUpdate(cli api.GobgpApiClient, update ovsdb.TableU func (m *OpsManager) handleBgpRouterUpdate(cli api.GobgpApiClient, update ovsdb.TableUpdate) { asn, id, err := m.getBGPRouterUUID() if err != nil { - log.Debugf("%s", err) + log.WithFields(log.Fields{ + "Topic": "openswitch", + "Error": err, + }).Debug("Could not get BGP Router UUID") return } for k, v := range update.Rows { @@ -375,7 +380,7 @@ func (m *OpsManager) handleRouteUpdate(cli api.GobgpApiClient, update ovsdb.Tabl log.WithFields(log.Fields{ "Topic": "openswitch", "Path": path, - "Err": err, + "Error": err, }).Debug("failed to parse path") return } @@ -580,7 +585,7 @@ func (m *OpsManager) GobgpMonitor(target string) { log.WithFields(log.Fields{ "Topic": "openswitch", "Type": "MonitorRequest", - "Err": err, + "Error": err, }).Error("failed parse path of gobgp") } o, err := m.TransactPreparation(p) @@ -588,7 +593,7 @@ func (m *OpsManager) GobgpMonitor(target string) { log.WithFields(log.Fields{ "Topic": "openswitch", "Type": "Monitor", - "Err": err, + "Error": err, }).Error("failed transact preparation of ops") } m.opsCh <- o |