File tree Expand file tree Collapse file tree 4 files changed +1
-35
lines changed Expand file tree Collapse file tree 4 files changed +1
-35
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,6 @@ import (
1010 "github.com/Azure/azure-container-networking/cni"
1111 "github.com/Azure/azure-container-networking/cni/ipam"
1212 "github.com/Azure/azure-container-networking/common"
13- "github.com/Azure/azure-container-networking/log"
1413)
1514
1615const name = "azure-vnet-ipam"
@@ -23,17 +22,6 @@ func main() {
2322 var config common.PluginConfig
2423 config .Version = version
2524
26- logDirectory := "" // Sets the current location as log directory
27-
28- log .SetName (name )
29- log .SetLevel (log .LevelInfo )
30- if err := log .SetTargetLogDirectory (log .TargetLogfile , logDirectory ); err != nil {
31- fmt .Printf ("Failed to setup cni logging: %v\n " , err )
32- return
33- }
34-
35- defer log .Close ()
36-
3725 ipamPlugin , err := ipam .NewPlugin (name , & config )
3826 if err != nil {
3927 fmt .Printf ("Failed to create IPAM plugin, err:%v.\n " , err )
Original file line number Diff line number Diff line change @@ -10,7 +10,6 @@ import (
1010 "github.com/Azure/azure-container-networking/cni"
1111 "github.com/Azure/azure-container-networking/cni/ipam"
1212 "github.com/Azure/azure-container-networking/common"
13- "github.com/Azure/azure-container-networking/log"
1413)
1514
1615const name = "azure-vnet-ipamv6"
@@ -23,17 +22,6 @@ func main() {
2322 var config common.PluginConfig
2423 config .Version = version
2524
26- logDirectory := "" // Sets the current location as log directory
27-
28- log .SetName (name )
29- log .SetLevel (log .LevelInfo )
30- if err := log .SetTargetLogDirectory (log .TargetLogfile , logDirectory ); err != nil {
31- fmt .Printf ("Failed to setup cni logging: %v\n " , err )
32- return
33- }
34-
35- defer log .Close ()
36-
3725 ipamPlugin , err := ipam .NewPlugin (name , & config )
3826 if err != nil {
3927 fmt .Printf ("Failed to create IPAM plugin, err:%v.\n " , err )
Original file line number Diff line number Diff line change @@ -903,7 +903,7 @@ func (plugin *NetPlugin) Get(args *cniSkel.CmdArgs) error {
903903
904904 // Query the endpoint.
905905 if epInfo , err = plugin .nm .GetEndpointInfo (networkID , endpointID ); err != nil {
906- plugin . Errorf ("Failed to query endpoint: %v " , err )
906+ logger . Error ("Failed to query endpoint" , zap . Error ( err ) )
907907 return err
908908 }
909909
Original file line number Diff line number Diff line change @@ -17,7 +17,6 @@ import (
1717 zaplog "github.com/Azure/azure-container-networking/cni/log"
1818 "github.com/Azure/azure-container-networking/cni/network"
1919 "github.com/Azure/azure-container-networking/common"
20- "github.com/Azure/azure-container-networking/log"
2120 "github.com/Azure/azure-container-networking/nns"
2221 "github.com/Azure/azure-container-networking/platform"
2322 "github.com/Azure/azure-container-networking/store"
@@ -295,15 +294,6 @@ func main() {
295294 os .Exit (0 )
296295 }
297296
298- log .SetName (name )
299- log .SetLevel (log .LevelInfo )
300- if err := log .SetTargetLogDirectory (log .TargetLogfile , "" ); err != nil {
301- fmt .Printf ("Failed to setup cni logging: %v\n " , err )
302- return
303- }
304-
305- defer log .Close ()
306-
307297 if rootExecute () != nil {
308298 os .Exit (1 )
309299 }
You can’t perform that action at this time.
0 commit comments