Skip to content

Commit

Permalink
main: silence all logrus logging for now
Browse files Browse the repository at this point in the history
This commit silences logrus logging for now by just dicarding
everything from it. The rational is that the underlying libraries
produce a lot of output, e.g. every build currently results in
```console
$ image-builder build qcow2
WARN[0000] Failed to load consumer certs: no consumer key found
...
```
which is confusing to our users. What is worse is that containers
also uses logrus so we can get random warnings without context
from there too. Until we have a way to filter log messages this
seems to be the most practical way.

We can add `--verbose` or `--debug` later to enable these kinds
of messages.
  • Loading branch information
mvo5 committed Jan 30, 2025
1 parent 0f0815d commit e7dfeb8
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions cmd/image-builder/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -203,9 +203,13 @@ func cmdBuild(cmd *cobra.Command, args []string) error {
}

func run() error {
// images logs a bunch of stuff to Debug/Info that is distracting
// the user (at least by default, like what repos being loaded)
logrus.SetLevel(logrus.WarnLevel)
// images generates a lot of noisy logs a bunch of stuff to
// Debug/Info that is distracting the user (at least by
// default, like what repos being loaded)
//
// Disable for now until we can filter out the usless log
// messages.
logrus.SetOutput(io.Discard)

rootCmd := &cobra.Command{
Use: "image-builder",
Expand Down

0 comments on commit e7dfeb8

Please sign in to comment.