From 97620a11232063a73bb1c958ffeb1a050960a9c2 Mon Sep 17 00:00:00 2001 From: Artem Glazychev Date: Tue, 9 Feb 2021 15:18:40 +0700 Subject: [PATCH] Update to latest sdk version Signed-off-by: Artem Glazychev --- go.mod | 2 +- go.sum | 4 +-- .../ipcontext/ipaddress/common.go | 4 +-- .../ipcontext/routes/common.go | 4 +-- .../ipcontext/ipaddress/common.go | 4 +-- .../ipcontext/routes/common.go | 6 ++--- .../mechanisms/kernel/kerneltap/common.go | 12 ++++----- .../kernel/kernelvethpair/afpacket/common.go | 8 +++--- .../kernel/kernelvethpair/common.go | 26 +++++++++---------- pkg/networkservice/mechanisms/memif/common.go | 12 ++++----- pkg/networkservice/mechanisms/vxlan/common.go | 4 +-- .../mechanisms/vxlan/vxlanacl/common.go | 14 +++++----- pkg/networkservice/tag/common.go | 4 +-- pkg/networkservice/up/common.go | 10 +++---- .../xconnect/l2xconnect/common.go | 6 ++--- 15 files changed, 60 insertions(+), 60 deletions(-) diff --git a/go.mod b/go.mod index 3e406a75..00fd8ba5 100644 --- a/go.mod +++ b/go.mod @@ -8,7 +8,7 @@ require ( github.com/golang/protobuf v1.4.3 github.com/hashicorp/go-multierror v1.0.0 github.com/networkservicemesh/api v0.0.0-20210202152048-ec956057eb3a - github.com/networkservicemesh/sdk v0.0.0-20210208092844-64f6aa269f63 + github.com/networkservicemesh/sdk v0.0.0-20210209072519-ac14b1d8f2ec github.com/pkg/errors v0.9.1 github.com/thanhpk/randstr v1.0.4 github.com/vishvananda/netlink v1.1.0 diff --git a/go.sum b/go.sum index 5cc01968..25094994 100644 --- a/go.sum +++ b/go.sum @@ -290,8 +290,8 @@ github.com/nats-io/stan.go v0.6.0/go.mod h1:eIcD5bi3pqbHT/xIIvXMwvzXYElgouBvaVRf github.com/nbutton23/zxcvbn-go v0.0.0-20180912185939-ae427f1e4c1d/go.mod h1:o96djdrsSGy3AWPyBgZMAGfxZNfgntdJG+11KU4QvbU= github.com/networkservicemesh/api v0.0.0-20210202152048-ec956057eb3a h1:26MmmU399gnahAC+f6OfWsP5MpnLdJ4UjvBa6fXYvNU= github.com/networkservicemesh/api v0.0.0-20210202152048-ec956057eb3a/go.mod h1:qvxdY1Zt4QTtiG+uH1XmjpegeHjlt5Jj4A8iK55iJPI= -github.com/networkservicemesh/sdk v0.0.0-20210208092844-64f6aa269f63 h1:fDvXYI18q3+DIN2zuljZXavL7IILWun2zafTa4llUG8= -github.com/networkservicemesh/sdk v0.0.0-20210208092844-64f6aa269f63/go.mod h1:gqv+RfDum4HBeZA0k+F96mT2m0rh9LZTUazjtsLJ0Bs= +github.com/networkservicemesh/sdk v0.0.0-20210209072519-ac14b1d8f2ec h1:DjdZBDjKzXRCE+Bzk1wu20FlA7Cu8J0aPDfkv86/6sQ= +github.com/networkservicemesh/sdk v0.0.0-20210209072519-ac14b1d8f2ec/go.mod h1:gqv+RfDum4HBeZA0k+F96mT2m0rh9LZTUazjtsLJ0Bs= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nishanths/exhaustive v0.0.0-20200811152831-6cf413ae40e0/go.mod h1:wBEpHwM2OdmeNpdCvRPUlkEbBuaFmcK4Wv8Q7FuGW3c= diff --git a/pkg/networkservice/connectioncontext/ipcontext/ipaddress/common.go b/pkg/networkservice/connectioncontext/ipcontext/ipaddress/common.go index 8d250df5..612d9b08 100644 --- a/pkg/networkservice/connectioncontext/ipcontext/ipaddress/common.go +++ b/pkg/networkservice/connectioncontext/ipcontext/ipaddress/common.go @@ -23,7 +23,7 @@ import ( "git.fd.io/govpp.git/api" interfaces "github.com/edwarnicke/govpp/binapi/interface" "github.com/networkservicemesh/api/pkg/api/networkservice" - "github.com/networkservicemesh/sdk/pkg/tools/logger" + "github.com/networkservicemesh/sdk/pkg/tools/log" "github.com/pkg/errors" "github.com/networkservicemesh/sdk-vpp/pkg/tools/ifindex" @@ -50,7 +50,7 @@ func addDel(ctx context.Context, conn *networkservice.Connection, vppConn api.Co }); err != nil { return errors.WithStack(err) } - logger.Log(ctx). + log.FromContext(ctx). WithField("swIfIndex", swIfIndex). WithField("prefix", ipNet). WithField("isAdd", isAdd). diff --git a/pkg/networkservice/connectioncontext/ipcontext/routes/common.go b/pkg/networkservice/connectioncontext/ipcontext/routes/common.go index 0324127c..f8e30b8a 100644 --- a/pkg/networkservice/connectioncontext/ipcontext/routes/common.go +++ b/pkg/networkservice/connectioncontext/ipcontext/routes/common.go @@ -26,7 +26,7 @@ import ( "github.com/edwarnicke/govpp/binapi/interface_types" "github.com/edwarnicke/govpp/binapi/ip" "github.com/networkservicemesh/api/pkg/api/networkservice" - "github.com/networkservicemesh/sdk/pkg/tools/logger" + "github.com/networkservicemesh/sdk/pkg/tools/log" "github.com/pkg/errors" "github.com/networkservicemesh/sdk-vpp/pkg/tools/ifindex" @@ -74,7 +74,7 @@ func routeAddDel(ctx context.Context, vppConn api.Connection, swIfIndex interfac }); err != nil { return errors.WithStack(err) } - logger.Log(ctx). + log.FromContext(ctx). WithField("swIfIndex", swIfIndex). WithField("prefix", prefix). WithField("isAdd", isAdd). diff --git a/pkg/networkservice/connectioncontextkernel/ipcontext/ipaddress/common.go b/pkg/networkservice/connectioncontextkernel/ipcontext/ipaddress/common.go index 5f0bbf02..ed855ee4 100644 --- a/pkg/networkservice/connectioncontextkernel/ipcontext/ipaddress/common.go +++ b/pkg/networkservice/connectioncontextkernel/ipcontext/ipaddress/common.go @@ -24,7 +24,7 @@ import ( "github.com/networkservicemesh/api/pkg/api/networkservice" "github.com/networkservicemesh/api/pkg/api/networkservice/mechanisms/kernel" - "github.com/networkservicemesh/sdk/pkg/tools/logger" + "github.com/networkservicemesh/sdk/pkg/tools/log" "github.com/pkg/errors" "github.com/vishvananda/netlink" @@ -61,7 +61,7 @@ func create(ctx context.Context, conn *networkservice.Connection, isClient bool) }); err != nil { return err } - logger.Log(ctx). + log.FromContext(ctx). WithField("link.Name", l.Attrs().Name). WithField("Addr", ipNet.String()). WithField("duration", time.Since(now)). diff --git a/pkg/networkservice/connectioncontextkernel/ipcontext/routes/common.go b/pkg/networkservice/connectioncontextkernel/ipcontext/routes/common.go index c21ebc04..282a51db 100644 --- a/pkg/networkservice/connectioncontextkernel/ipcontext/routes/common.go +++ b/pkg/networkservice/connectioncontextkernel/ipcontext/routes/common.go @@ -23,7 +23,7 @@ import ( "net" "time" - "github.com/networkservicemesh/sdk/pkg/tools/logger" + "github.com/networkservicemesh/sdk/pkg/tools/log" "github.com/networkservicemesh/api/pkg/api/networkservice" "github.com/networkservicemesh/api/pkg/api/networkservice/mechanisms/kernel" @@ -67,7 +67,7 @@ func create(ctx context.Context, conn *networkservice.Connection, isClient bool) } for _, route := range routes { if route.GetPrefixIPNet() == nil || to.Contains(route.GetPrefixIPNet().IP) { - logger.Log(ctx).Debugf("Skipping adding route %+v because it prefix %s is contained in %s", route, route.GetPrefixIPNet(), to) + log.FromContext(ctx).Debugf("Skipping adding route %+v because it prefix %s is contained in %s", route, route.GetPrefixIPNet(), to) continue } if err := routeAdd(ctx, handle, l, netlink.SCOPE_UNIVERSE, route.GetPrefixIPNet(), to); err != nil { @@ -91,7 +91,7 @@ func routeAdd(ctx context.Context, handle *netlink.Handle, l netlink.Link, scope if err := handle.RouteAdd(route); err != nil { return errors.WithStack(err) } - logger.Log(ctx). + log.FromContext(ctx). WithField("link.Name", l.Attrs().Name). WithField("route.Dst", route.Dst). WithField("route.Gw", route.Gw). diff --git a/pkg/networkservice/mechanisms/kernel/kerneltap/common.go b/pkg/networkservice/mechanisms/kernel/kerneltap/common.go index bd0b8aed..2b4a3d37 100644 --- a/pkg/networkservice/mechanisms/kernel/kerneltap/common.go +++ b/pkg/networkservice/mechanisms/kernel/kerneltap/common.go @@ -28,7 +28,7 @@ import ( "github.com/edwarnicke/govpp/binapi/tapv2" "github.com/networkservicemesh/api/pkg/api/networkservice" "github.com/networkservicemesh/api/pkg/api/networkservice/mechanisms/kernel" - "github.com/networkservicemesh/sdk/pkg/tools/logger" + "github.com/networkservicemesh/sdk/pkg/tools/log" "github.com/pkg/errors" "github.com/networkservicemesh/sdk-vpp/pkg/tools/ifindex" @@ -63,7 +63,7 @@ func create(ctx context.Context, conn *networkservice.Connection, vppConn api.Co if err != nil { return errors.WithStack(err) } - logger.Log(ctx). + log.FromContext(ctx). WithField("swIfIndex", rsp.SwIfIndex). WithField("HostIfName", tapCreateV2.HostIfName). WithField("HostNamespace", tapCreateV2.HostNamespace). @@ -78,7 +78,7 @@ func create(ctx context.Context, conn *networkservice.Connection, vppConn api.Co }); err != nil { return errors.WithStack(err) } - logger.Log(ctx). + log.FromContext(ctx). WithField("swIfIndex", rsp.SwIfIndex). WithField("mode", interface_types.RX_MODE_API_ADAPTIVE). WithField("duration", time.Since(now)). @@ -94,7 +94,7 @@ func create(ctx context.Context, conn *networkservice.Connection, vppConn api.Co if err != nil { return errors.Wrapf(err, "unable to find hostIfName %s", tapCreateV2.HostIfName) } - logger.Log(ctx). + log.FromContext(ctx). WithField("link.Name", tapCreateV2.HostIfName). WithField("duration", time.Since(now)). WithField("netlink", "LinkByName").Debug("completed") @@ -106,7 +106,7 @@ func create(ctx context.Context, conn *networkservice.Connection, vppConn api.Co if err = handle.LinkSetAlias(l, alias); err != nil { return errors.WithStack(err) } - logger.Log(ctx). + log.FromContext(ctx). WithField("link.Name", l.Attrs().Name). WithField("alias", alias). WithField("duration", time.Since(now)). @@ -118,7 +118,7 @@ func create(ctx context.Context, conn *networkservice.Connection, vppConn api.Co if err != nil { return errors.WithStack(err) } - logger.Log(ctx). + log.FromContext(ctx). WithField("link.Name", l.Attrs().Name). WithField("duration", time.Since(now)). WithField("netlink", "LinkSetUp").Debug("completed") diff --git a/pkg/networkservice/mechanisms/kernel/kernelvethpair/afpacket/common.go b/pkg/networkservice/mechanisms/kernel/kernelvethpair/afpacket/common.go index 7e46adae..96aef183 100644 --- a/pkg/networkservice/mechanisms/kernel/kernelvethpair/afpacket/common.go +++ b/pkg/networkservice/mechanisms/kernel/kernelvethpair/afpacket/common.go @@ -28,7 +28,7 @@ import ( "github.com/edwarnicke/govpp/binapi/interface_types" "github.com/networkservicemesh/api/pkg/api/networkservice" "github.com/networkservicemesh/api/pkg/api/networkservice/mechanisms/kernel" - "github.com/networkservicemesh/sdk/pkg/tools/logger" + "github.com/networkservicemesh/sdk/pkg/tools/log" "github.com/pkg/errors" "github.com/networkservicemesh/sdk-vpp/pkg/networkservice/up" @@ -52,7 +52,7 @@ func create(ctx context.Context, conn *networkservice.Connection, vppConn api.Co if err != nil { return errors.WithStack(err) } - logger.Log(ctx). + log.FromContext(ctx). WithField("swIfIndex", rsp.SwIfIndex). WithField("duration", time.Since(now)). WithField("vppapi", "AfPacketCreate").Debug("completed") @@ -65,7 +65,7 @@ func create(ctx context.Context, conn *networkservice.Connection, vppConn api.Co }); err != nil { return errors.WithStack(err) } - logger.Log(ctx). + log.FromContext(ctx). WithField("swIfIndex", rsp.SwIfIndex). WithField("mode", interface_types.RX_MODE_API_ADAPTIVE). WithField("duration", time.Since(now)). @@ -92,7 +92,7 @@ func del(ctx context.Context, conn *networkservice.Connection, vppConn api.Conne if err != nil { return errors.WithStack(err) } - logger.Log(ctx). + log.FromContext(ctx). WithField("swIfIndex", swIfIndex). WithField("duration", time.Since(now)). WithField("vppapi", "AfPacketDelete").Debug("completed") diff --git a/pkg/networkservice/mechanisms/kernel/kernelvethpair/common.go b/pkg/networkservice/mechanisms/kernel/kernelvethpair/common.go index adb473c8..3a8836a8 100644 --- a/pkg/networkservice/mechanisms/kernel/kernelvethpair/common.go +++ b/pkg/networkservice/mechanisms/kernel/kernelvethpair/common.go @@ -28,7 +28,7 @@ import ( "github.com/networkservicemesh/sdk-vpp/pkg/tools/ethtool" - "github.com/networkservicemesh/sdk/pkg/tools/logger" + "github.com/networkservicemesh/sdk/pkg/tools/log" "github.com/pkg/errors" "github.com/thanhpk/randstr" "github.com/vishvananda/netlink" @@ -55,7 +55,7 @@ func create(ctx context.Context, conn *networkservice.Connection, isClient bool) if addErr := netlink.LinkAdd(l); addErr != nil { return addErr } - logger.Log(ctx). + log.FromContext(ctx). WithField("link.Name", l.Attrs().Name). WithField("link.PeerName", veth.PeerName). WithField("duration", time.Since(now)). @@ -81,7 +81,7 @@ func create(ctx context.Context, conn *networkservice.Connection, isClient bool) if err = netlink.LinkSetNsFd(l, int(nsHandle)); err != nil { return errors.Wrapf(err, "unable to change to netns") } - logger.Log(ctx). + log.FromContext(ctx). WithField("link.Name", l.Attrs().Name). WithField("duration", time.Since(now)). WithField("netlink", "LinkSetNsFd").Debug("completed") @@ -91,14 +91,14 @@ func create(ctx context.Context, conn *networkservice.Connection, isClient bool) name := l.Attrs().Name l, err = handle.LinkByName(name) if err != nil { - logger.Log(ctx). + log.FromContext(ctx). WithField("duration", time.Since(now)). WithField("link.Name", name). WithField("err", err). WithField("netlink", "LinkByName").Debug("error") return errors.WithStack(err) } - logger.Log(ctx). + log.FromContext(ctx). WithField("duration", time.Since(now)). WithField("link.Name", name). WithField("netlink", "LinkByName").Debug("completed") @@ -107,7 +107,7 @@ func create(ctx context.Context, conn *networkservice.Connection, isClient bool) // Set the LinkName now = time.Now() if err = handle.LinkSetName(l, name); err != nil { - logger.Log(ctx). + log.FromContext(ctx). WithField("link.Name", l.Attrs().Name). WithField("link.NewName", name). WithField("duration", time.Since(now)). @@ -115,7 +115,7 @@ func create(ctx context.Context, conn *networkservice.Connection, isClient bool) WithField("netlink", "LinkSetName").Debug("error") return errors.WithStack(err) } - logger.Log(ctx). + log.FromContext(ctx). WithField("link.Name", l.Attrs().Name). WithField("link.NewName", name). WithField("duration", time.Since(now)). @@ -126,7 +126,7 @@ func create(ctx context.Context, conn *networkservice.Connection, isClient bool) if err = handle.LinkSetAlias(l, alias); err != nil { return errors.WithStack(err) } - logger.Log(ctx). + log.FromContext(ctx). WithField("link.Name", l.Attrs().Name). WithField("alias", alias). WithField("duration", time.Since(now)). @@ -138,7 +138,7 @@ func create(ctx context.Context, conn *networkservice.Connection, isClient bool) if err != nil { return errors.WithStack(err) } - logger.Log(ctx). + log.FromContext(ctx). WithField("link.Name", l.Attrs().Name). WithField("duration", time.Since(now)). WithField("netlink", "LinkSetUp").Debug("completed") @@ -150,7 +150,7 @@ func create(ctx context.Context, conn *networkservice.Connection, isClient bool) _ = netlink.LinkDel(l) return err } - logger.Log(ctx). + log.FromContext(ctx). WithField("link.Name", veth.PeerName). WithField("duration", time.Since(now)). WithField("netlink", "LinkByName").Debug("completed") @@ -162,7 +162,7 @@ func create(ctx context.Context, conn *networkservice.Connection, isClient bool) _ = netlink.LinkDel(peerLink) return err } - logger.Log(ctx). + log.FromContext(ctx). WithField("link.Name", peerLink.Attrs().Name). WithField("peerLink", fmt.Sprintf("veth-%s", alias)). WithField("duration", time.Since(now)). @@ -176,7 +176,7 @@ func create(ctx context.Context, conn *networkservice.Connection, isClient bool) _ = netlink.LinkDel(peerLink) return err } - logger.Log(ctx). + log.FromContext(ctx). WithField("link.Name", peerLink.Attrs().Name). WithField("duration", time.Since(now)). WithField("netlink", "LinkSetUp").Debug("completed") @@ -195,7 +195,7 @@ func del(ctx context.Context, conn *networkservice.Connection, isClient bool) er if err := netlink.LinkDel(peerLink); err != nil { return err } - logger.Log(ctx). + log.FromContext(ctx). WithField("link.Name", peerLink.Attrs().Name). WithField("duration", time.Since(now)). WithField("netlink", "LinkDel").Debug("completed") diff --git a/pkg/networkservice/mechanisms/memif/common.go b/pkg/networkservice/mechanisms/memif/common.go index dc85f34b..4bb8fcaa 100644 --- a/pkg/networkservice/mechanisms/memif/common.go +++ b/pkg/networkservice/mechanisms/memif/common.go @@ -30,7 +30,7 @@ import ( "github.com/edwarnicke/govpp/binapi/memif" "github.com/networkservicemesh/api/pkg/api/networkservice" memifMech "github.com/networkservicemesh/api/pkg/api/networkservice/mechanisms/memif" - "github.com/networkservicemesh/sdk/pkg/tools/logger" + "github.com/networkservicemesh/sdk/pkg/tools/log" "github.com/pkg/errors" "github.com/networkservicemesh/sdk-vpp/pkg/networkservice/up" @@ -60,7 +60,7 @@ func createMemifSocket(ctx context.Context, mechanism *memifMech.Mechanism, vppC if _, err := memif.NewServiceClient(vppConn).MemifSocketFilenameAddDel(ctx, memifSocketAddDel); err != nil { return 0, errors.WithStack(err) } - logger.Log(ctx). + log.FromContext(ctx). WithField("SocketID", memifSocketAddDel.SocketID). WithField("SocketFilename", memifSocketAddDel.SocketFilename). WithField("IsAdd", memifSocketAddDel.IsAdd). @@ -80,7 +80,7 @@ func deleteMemifSocket(ctx context.Context, vppConn api.Connection, isClient boo if _, err := memif.NewServiceClient(vppConn).MemifSocketFilenameAddDel(ctx, memifSocketAddDel); err != nil { return errors.WithStack(err) } - logger.Log(ctx). + log.FromContext(ctx). WithField("SocketID", memifSocketAddDel.SocketID). WithField("SocketFilename", memifSocketAddDel.SocketFilename). WithField("IsAdd", memifSocketAddDel.IsAdd). @@ -103,7 +103,7 @@ func createMemif(ctx context.Context, vppConn api.Connection, socketID uint32, i if err != nil { return errors.WithStack(err) } - logger.Log(ctx). + log.FromContext(ctx). WithField("swIfIndex", rsp.SwIfIndex). WithField("Role", memifCreate.Role). WithField("SocketID", memifCreate.SocketID). @@ -118,7 +118,7 @@ func createMemif(ctx context.Context, vppConn api.Connection, socketID uint32, i }); err != nil { return errors.WithStack(err) } - logger.Log(ctx). + log.FromContext(ctx). WithField("swIfIndex", rsp.SwIfIndex). WithField("mode", interface_types.RX_MODE_API_ADAPTIVE). WithField("duration", time.Since(now)). @@ -143,7 +143,7 @@ func deleteMemif(ctx context.Context, vppConn api.Connection, isClient bool) err if err != nil { return errors.WithStack(err) } - logger.Log(ctx). + log.FromContext(ctx). WithField("swIfIndex", memifDel.SwIfIndex). WithField("duration", time.Since(now)). WithField("vppapi", "MemifDelete").Debug("completed") diff --git a/pkg/networkservice/mechanisms/vxlan/common.go b/pkg/networkservice/mechanisms/vxlan/common.go index f2a1b26c..c3aa3eed 100644 --- a/pkg/networkservice/mechanisms/vxlan/common.go +++ b/pkg/networkservice/mechanisms/vxlan/common.go @@ -26,7 +26,7 @@ import ( "github.com/networkservicemesh/api/pkg/api/networkservice" vxlanMech "github.com/networkservicemesh/api/pkg/api/networkservice/mechanisms/vxlan" - "github.com/networkservicemesh/sdk/pkg/tools/logger" + "github.com/networkservicemesh/sdk/pkg/tools/log" "github.com/networkservicemesh/sdk-vpp/pkg/tools/ifindex" "github.com/networkservicemesh/sdk-vpp/pkg/tools/types" @@ -65,7 +65,7 @@ func addDel(ctx context.Context, conn *networkservice.Connection, vppConn api.Co if err != nil { return errors.WithStack(err) } - logger.Log(ctx). + log.FromContext(ctx). WithField("swIfIndex", rsp.SwIfIndex). WithField("SrcAddress", vxlanAddDelTunnel.SrcAddress). WithField("DstAddress", vxlanAddDelTunnel.DstAddress). diff --git a/pkg/networkservice/mechanisms/vxlan/vxlanacl/common.go b/pkg/networkservice/mechanisms/vxlan/vxlanacl/common.go index 835b1af1..3cd84931 100644 --- a/pkg/networkservice/mechanisms/vxlan/vxlanacl/common.go +++ b/pkg/networkservice/mechanisms/vxlan/vxlanacl/common.go @@ -30,7 +30,7 @@ import ( "github.com/edwarnicke/govpp/binapi/ip_types" "github.com/pkg/errors" - "github.com/networkservicemesh/sdk/pkg/tools/logger" + "github.com/networkservicemesh/sdk/pkg/tools/log" "github.com/networkservicemesh/sdk-vpp/pkg/tools/types" ) @@ -75,7 +75,7 @@ func create(ctx context.Context, vppConn api.Connection, tunnelIP net.IP, tag st if err != nil { return errors.WithStack(err) } - logger.Log(ctx). + log.FromContext(ctx). WithField("swIfIndex", interfaceACLList.SwIfIndex). WithField("acls", interfaceACLList.Acls). WithField("NInput", interfaceACLList.NInput). @@ -100,7 +100,7 @@ func addToVxlanACLToACLListIfNeeded(ctx context.Context, vppConn api.Connection, if err != nil { return nil, errors.WithStack(err) } - logger.Log(ctx). + log.FromContext(ctx). WithField("aclIndex", rsp.ACLIndex). WithField("duration", time.Since(now)). WithField("vppapi", "ACLAddReplace").Debug("completed") @@ -139,7 +139,7 @@ func aclDetails(ctx context.Context, vppConn api.Connection, aclIndeces []uint32 if err != nil { return nil, errors.WithStack(err) } - logger.Log(ctx). + log.FromContext(ctx). WithField("aclIndex", aclIndex). WithField("duration", time.Since(now)). WithField("vppapi", "ACLDump").Debugf("completed") @@ -161,7 +161,7 @@ func interfaceACLIndeces(ctx context.Context, vppConn api.Connection, swIfIndex if err != nil { return nil, nil, errors.WithStack(err) } - logger.Log(ctx). + log.FromContext(ctx). WithField("swIfIndex", swIfIndex). WithField("duration", time.Since(now)). WithField("vppapi", "ACLInterfaceListDump").Debug("initiated") @@ -190,7 +190,7 @@ func vxlanSwIfIndex(ctx context.Context, vppConn api.Connection, tunnelIP net.IP ipDetails, ipDumpErr := ipDumpClient.Recv() for ipDumpErr == nil { if types.FromVppAddressWithPrefix(ipDetails.Prefix).IP.Equal(tunnelIP) { - logger.Log(ctx). + log.FromContext(ctx). WithField("swIfIndex", swIfDetails.SwIfIndex). WithField("duration", time.Since(now)). WithField("vppapi", "SwInterfaceDump").Debugf("found interface with ip %s", tunnelIP) @@ -200,7 +200,7 @@ func vxlanSwIfIndex(ctx context.Context, vppConn api.Connection, tunnelIP net.IP } swIfDetails, swIfDumpErr = swIfDumpClient.Recv() } - logger.Log(ctx). + log.FromContext(ctx). WithField("swIfIndex", swIfDetails.SwIfIndex). WithField("duration", time.Since(now)). WithField("vppapi", "SwInterfaceDump").Debugf("did not find interface with ip %s", tunnelIP) diff --git a/pkg/networkservice/tag/common.go b/pkg/networkservice/tag/common.go index 22800fdf..e42a43c7 100644 --- a/pkg/networkservice/tag/common.go +++ b/pkg/networkservice/tag/common.go @@ -23,7 +23,7 @@ import ( "git.fd.io/govpp.git/api" interfaces "github.com/edwarnicke/govpp/binapi/interface" "github.com/networkservicemesh/api/pkg/api/networkservice" - "github.com/networkservicemesh/sdk/pkg/tools/logger" + "github.com/networkservicemesh/sdk/pkg/tools/log" "github.com/pkg/errors" "github.com/networkservicemesh/sdk-vpp/pkg/tools/ifindex" @@ -42,7 +42,7 @@ func create(ctx context.Context, conn *networkservice.Connection, vppConn api.Co }); err != nil { return errors.WithStack(err) } - logger.Log(ctx). + log.FromContext(ctx). WithField("swIfIndex", swIfIndex). WithField("tag", conn.GetId()). WithField("duration", time.Since(now)). diff --git a/pkg/networkservice/up/common.go b/pkg/networkservice/up/common.go index 100cdf21..e279c39d 100644 --- a/pkg/networkservice/up/common.go +++ b/pkg/networkservice/up/common.go @@ -24,7 +24,7 @@ import ( "git.fd.io/govpp.git/api" interfaces "github.com/edwarnicke/govpp/binapi/interface" "github.com/edwarnicke/govpp/binapi/interface_types" - "github.com/networkservicemesh/sdk/pkg/tools/logger" + "github.com/networkservicemesh/sdk/pkg/tools/log" "github.com/pkg/errors" "github.com/networkservicemesh/sdk-vpp/pkg/tools/ifindex" @@ -49,7 +49,7 @@ func up(ctx context.Context, vppConn api.Connection, apiChannel api.Channel, isC }); err != nil { return errors.WithStack(err) } - logger.Log(ctx). + log.FromContext(ctx). WithField("swIfIndex", swIfIndex). WithField("duration", time.Since(now)). WithField("vppapi", "SwInterfaceSetFlags").Debug("completed") @@ -81,7 +81,7 @@ func waitForUpLinkUp(ctx context.Context, vppConn api.Connection, apiChannel api if err != nil { return errors.Wrapf(err, "error retrieving SwInterfaceDetails for swIfIndex %d", swIfIndex) } - logger.Log(ctx). + log.FromContext(ctx). WithField("swIfIndex", swIfIndex). WithField("details.Flags", details.Flags). WithField("duration", time.Since(now)). @@ -99,7 +99,7 @@ func waitForUpLinkUp(ctx context.Context, vppConn api.Connection, apiChannel api if msg, ok := rawMsg.(*interfaces.SwInterfaceEvent); ok && msg.SwIfIndex == swIfIndex && msg.Flags&interface_types.IF_STATUS_API_FLAG_LINK_UP != 0 { - logger.Log(ctx). + log.FromContext(ctx). WithField("swIfIndex", swIfIndex). WithField("msg.Flags", msg.Flags). WithField("duration", time.Since(now)). @@ -124,7 +124,7 @@ func initFunc(ctx context.Context, vppConn Connection) (api.Channel, error) { apiChannel.Close() return nil, errors.WithStack(err) } - logger.Log(ctx). + log.FromContext(ctx). WithField("duration", time.Since(now)). WithField("vppapi", "WantInterfaceEvents").Info("completed") diff --git a/pkg/networkservice/xconnect/l2xconnect/common.go b/pkg/networkservice/xconnect/l2xconnect/common.go index 69a1c936..edb8ca45 100644 --- a/pkg/networkservice/xconnect/l2xconnect/common.go +++ b/pkg/networkservice/xconnect/l2xconnect/common.go @@ -24,7 +24,7 @@ import ( "github.com/edwarnicke/govpp/binapi/l2" "github.com/pkg/errors" - "github.com/networkservicemesh/sdk/pkg/tools/logger" + "github.com/networkservicemesh/sdk/pkg/tools/log" "github.com/networkservicemesh/sdk-vpp/pkg/tools/ifindex" ) @@ -47,7 +47,7 @@ func addDel(ctx context.Context, vppConn api.Connection, addDel bool) error { }); err != nil { return errors.WithStack(err) } - logger.Log(ctx). + log.FromContext(ctx). WithField("RxSwIfIndex", clientIfIndex). WithField("TxSwIfIndex", serverIfIndex). WithField("Enable", addDel). @@ -62,7 +62,7 @@ func addDel(ctx context.Context, vppConn api.Connection, addDel bool) error { }); err != nil { return errors.WithStack(err) } - logger.Log(ctx). + log.FromContext(ctx). WithField("RxSwIfIndex", serverIfIndex). WithField("TxSwIfIndex", clientIfIndex). WithField("Enable", addDel).