Adjust logrus default logging level to silence some containerd logs

This commit is contained in:
Tianon Gravi 2022-03-03 13:01:43 -08:00
parent b2cbaa3678
commit eb66051aab
2 changed files with 7 additions and 0 deletions

View File

@ -6,6 +6,7 @@ import (
"path/filepath"
"strings"
"github.com/sirupsen/logrus" // this is used by containerd libraries, so we need to set the default log level for it
"github.com/urfave/cli"
"github.com/docker-library/bashbrew/architecture"
@ -163,6 +164,11 @@ func main() {
debugFlag = c.GlobalBool("debug")
noSortFlag = c.GlobalBool("no-sort")
if !debugFlag {
// containerd uses logrus, but it defaults to "info" (which is a bit leaky where we use containerd)
logrus.SetLevel(logrus.WarnLevel)
}
arch = c.GlobalString("arch")
namespace = c.GlobalString("namespace")
constraints = c.GlobalStringSlice("constraint")

1
go.mod
View File

@ -12,6 +12,7 @@ require (
github.com/klauspost/compress v1.13.6 // indirect
github.com/opencontainers/image-spec v1.0.2
github.com/sergi/go-diff v1.2.0 // indirect
github.com/sirupsen/logrus v1.8.1
github.com/urfave/cli v1.22.5
github.com/xanzy/ssh-agent v0.3.1 // indirect
golang.org/x/crypto v0.0.0-20211117183948-ae814b36b871 // indirect