From eb66051aab080f2039d946445faeb9df7ae53360 Mon Sep 17 00:00:00 2001 From: Tianon Gravi Date: Thu, 3 Mar 2022 13:01:43 -0800 Subject: [PATCH] Adjust logrus default logging level to silence some containerd logs --- cmd/bashbrew/main.go | 6 ++++++ go.mod | 1 + 2 files changed, 7 insertions(+) diff --git a/cmd/bashbrew/main.go b/cmd/bashbrew/main.go index 7689349..a850c07 100644 --- a/cmd/bashbrew/main.go +++ b/cmd/bashbrew/main.go @@ -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") diff --git a/go.mod b/go.mod index c2f9224..2c24093 100644 --- a/go.mod +++ b/go.mod @@ -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