From a0be57f64fff7bd49ecd459f4aa1577ad4db7e3d Mon Sep 17 00:00:00 2001 From: "James O. D. Hunt" Date: Thu, 26 Jul 2018 14:14:17 +0100 Subject: [PATCH] network: Always call network logger function Rather than using the virtcontainers logger, always call the network logger function. Signed-off-by: James O. D. Hunt --- virtcontainers/network.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/virtcontainers/network.go b/virtcontainers/network.go index 15401af65..7adde3c6f 100644 --- a/virtcontainers/network.go +++ b/virtcontainers/network.go @@ -489,7 +489,7 @@ func (n *NetworkNamespace) UnmarshalJSON(b []byte) error { } endpoints = append(endpoints, &endpoint) - virtLog.Infof("Physical endpoint unmarshalled [%v]", endpoint) + networkLogger().Infof("Physical endpoint unmarshalled [%v]", endpoint) case VirtualEndpointType: var endpoint VirtualEndpoint @@ -499,7 +499,7 @@ func (n *NetworkNamespace) UnmarshalJSON(b []byte) error { } endpoints = append(endpoints, &endpoint) - virtLog.Infof("Virtual endpoint unmarshalled [%v]", endpoint) + networkLogger().Infof("Virtual endpoint unmarshalled [%v]", endpoint) case VhostUserEndpointType: var endpoint VhostUserEndpoint @@ -509,10 +509,10 @@ func (n *NetworkNamespace) UnmarshalJSON(b []byte) error { } endpoints = append(endpoints, &endpoint) - virtLog.Infof("VhostUser endpoint unmarshalled [%v]", endpoint) + networkLogger().Infof("VhostUser endpoint unmarshalled [%v]", endpoint) default: - virtLog.Errorf("Unknown endpoint type received %s\n", e.Type) + networkLogger().Errorf("Unknown endpoint type received %s\n", e.Type) } } @@ -1010,7 +1010,7 @@ func untapNetworkPair(netPair NetworkInterfacePair) error { vethLink, err := getLinkByName(netHandle, netPair.VirtIface.Name, &netlink.Veth{}) if err != nil { // The veth pair is not totally managed by virtcontainers - virtLog.Warnf("Could not get veth interface %s: %s", netPair.VirtIface.Name, err) + networkLogger().Warnf("Could not get veth interface %s: %s", netPair.VirtIface.Name, err) } else { if err := netHandle.LinkSetDown(vethLink); err != nil { return fmt.Errorf("Could not disable veth %s: %s", netPair.VirtIface.Name, err) @@ -1062,7 +1062,7 @@ func unBridgeNetworkPair(netPair NetworkInterfacePair) error { vethLink, err := getLinkByName(netHandle, netPair.VirtIface.Name, &netlink.Veth{}) if err != nil { // The veth pair is not totally managed by virtcontainers - virtLog.WithError(err).Warn("Could not get veth interface") + networkLogger().WithError(err).Warn("Could not get veth interface") } else { if err := netHandle.LinkSetDown(vethLink); err != nil { return fmt.Errorf("Could not disable veth %s: %s", netPair.VirtIface.Name, err)