Skip to content

Commit eb66051

Browse files
committed
Adjust logrus default logging level to silence some containerd logs
1 parent b2cbaa3 commit eb66051

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

cmd/bashbrew/main.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
"path/filepath"
77
"strings"
88

9+
"github.com/sirupsen/logrus" // this is used by containerd libraries, so we need to set the default log level for it
910
"github.com/urfave/cli"
1011

1112
"github.com/docker-library/bashbrew/architecture"
@@ -163,6 +164,11 @@ func main() {
163164
debugFlag = c.GlobalBool("debug")
164165
noSortFlag = c.GlobalBool("no-sort")
165166

167+
if !debugFlag {
168+
// containerd uses logrus, but it defaults to "info" (which is a bit leaky where we use containerd)
169+
logrus.SetLevel(logrus.WarnLevel)
170+
}
171+
166172
arch = c.GlobalString("arch")
167173
namespace = c.GlobalString("namespace")
168174
constraints = c.GlobalStringSlice("constraint")

go.mod

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ require (
1212
github.com/klauspost/compress v1.13.6 // indirect
1313
github.com/opencontainers/image-spec v1.0.2
1414
github.com/sergi/go-diff v1.2.0 // indirect
15+
github.com/sirupsen/logrus v1.8.1
1516
github.com/urfave/cli v1.22.5
1617
github.com/xanzy/ssh-agent v0.3.1 // indirect
1718
golang.org/x/crypto v0.0.0-20211117183948-ae814b36b871 // indirect

0 commit comments

Comments
 (0)