Skip to content

Commit c0a89cf

Browse files
committed
main: enable logrus in --verbose mode
osbuild/images still use logrus for some its logging, so let's enable it as well until we can fully migrate over.
1 parent 056ffa4 commit c0a89cf

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

cmd/image-builder/main.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import (
1313
"strings"
1414
"syscall"
1515

16+
"github.com/sirupsen/logrus"
1617
"github.com/spf13/cobra"
1718
"github.com/spf13/pflag"
1819

@@ -655,7 +656,11 @@ operating systems like Fedora, CentOS and RHEL with easy customizations support.
655656
if verbose {
656657
olog.SetDefault(log.New(os.Stderr, "", 0))
657658
olog.Print("verbose logging enabled")
658-
// XXX: add once images has olog support
659+
// osbuild/images still partially uses logrus, so enable it here as well
660+
logrus.SetLevel(logrus.DebugLevel)
661+
logrus.SetOutput(os.Stderr)
662+
logrus.Debug("legacy logrus logging enabled")
663+
// XXX: add once images has olog support, and drop logrus
659664
//images_log.SetDefault(log.New(os.Stderr, "", 0))
660665
}
661666
return nil

0 commit comments

Comments
 (0)