@@ -30,10 +30,10 @@ import (
3030
3131 "github.com/containerd/containerd"
3232 "github.com/containerd/containerd/integration/remote"
33+ "github.com/containerd/containerd/log"
3334 "github.com/containerd/containerd/namespaces"
3435 "github.com/containerd/containerd/plugin"
3536 metrics "github.com/docker/go-metrics"
36- "github.com/sirupsen/logrus"
3737 "github.com/urfave/cli"
3838)
3939
@@ -177,10 +177,14 @@ func main() {
177177 }
178178 app .Before = func (context * cli.Context ) error {
179179 if context .GlobalBool ("json" ) {
180- logrus .SetLevel (logrus .WarnLevel )
180+ if err := log .SetLevel ("warn" ); err != nil {
181+ return err
182+ }
181183 }
182184 if context .GlobalBool ("debug" ) {
183- logrus .SetLevel (logrus .DebugLevel )
185+ if err := log .SetLevel ("debug" ); err != nil {
186+ return err
187+ }
184188 }
185189 return nil
186190 }
@@ -241,7 +245,7 @@ func serve(c config) error {
241245 ReadHeaderTimeout : 5 * time .Minute , // "G112: Potential Slowloris Attack (gosec)"; not a real concern for our use, so setting a long timeout.
242246 }
243247 if err := srv .ListenAndServe (); err != nil {
244- logrus .WithError (err ).Error ("listen and serve" )
248+ log . L .WithError (err ).Error ("listen and serve" )
245249 }
246250 }()
247251 checkBinarySizes ()
@@ -287,7 +291,7 @@ func criTest(c config) error {
287291 workers []worker
288292 r = & run {}
289293 )
290- logrus .Info ("starting stress test run..." )
294+ log . L .Info ("starting stress test run..." )
291295 // create the workers along with their spec
292296 for i := 0 ; i < c .Concurrency ; i ++ {
293297 wg .Add (1 )
@@ -312,9 +316,9 @@ func criTest(c config) error {
312316 r .end ()
313317
314318 results := r .gather (workers )
315- logrus .Infof ("ending test run in %0.3f seconds" , results .Seconds )
319+ log . L .Infof ("ending test run in %0.3f seconds" , results .Seconds )
316320
317- logrus .WithField ("failures" , r .failures ).Infof (
321+ log . L .WithField ("failures" , r .failures ).Infof (
318322 "create/start/delete %d containers in %0.3f seconds (%0.3f c/sec) or (%0.3f sec/c)" ,
319323 results .Total ,
320324 results .Seconds ,
@@ -345,7 +349,7 @@ func test(c config) error {
345349 return err
346350 }
347351
348- logrus .Infof ("pulling %s" , c .Image )
352+ log . L .Infof ("pulling %s" , c .Image )
349353 image , err := client .Pull (ctx , c .Image , containerd .WithPullUnpack , containerd .WithPullSnapshotter (c .Snapshotter ))
350354 if err != nil {
351355 return err
@@ -367,7 +371,7 @@ func test(c config) error {
367371 workers []worker
368372 r = & run {}
369373 )
370- logrus .Info ("starting stress test run..." )
374+ log . L .Info ("starting stress test run..." )
371375 // create the workers along with their spec
372376 for i := 0 ; i < c .Concurrency ; i ++ {
373377 wg .Add (1 )
@@ -414,9 +418,9 @@ func test(c config) error {
414418 results .ExecTotal = exec .count
415419 results .ExecFailures = exec .failures
416420 }
417- logrus .Infof ("ending test run in %0.3f seconds" , results .Seconds )
421+ log . L .Infof ("ending test run in %0.3f seconds" , results .Seconds )
418422
419- logrus .WithField ("failures" , r .failures ).Infof (
423+ log . L .WithField ("failures" , r .failures ).Infof (
420424 "create/start/delete %d containers in %0.3f seconds (%0.3f c/sec) or (%0.3f sec/c)" ,
421425 results .Total ,
422426 results .Seconds ,
0 commit comments