From 8e9aa1488253e3b508620c4e100fd98e84e5bce9 Mon Sep 17 00:00:00 2001 From: Andreas Lutro Date: Mon, 31 Aug 2020 22:01:56 +0200 Subject: [PATCH] print-ir: print validation warnings/errors to stderr (#841) --- commands/printIR.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/commands/printIR.go b/commands/printIR.go index 15b9a1f62..c8aa4fa27 100644 --- a/commands/printIR.go +++ b/commands/printIR.go @@ -3,6 +3,7 @@ package commands import ( "encoding/json" "fmt" + "log" "os" "github.com/urfave/cli/v2" @@ -83,13 +84,13 @@ func PrintValidationErrors(errs []error) (fatal bool) { if len(errs) == 0 { return false } - fmt.Printf("%d Validation errors:\n", len(errs)) + log.Printf("%d Validation errors:\n", len(errs)) for _, err := range errs { if _, ok := err.(normalize.Warning); ok { - fmt.Printf("WARNING: %s\n", err) + log.Printf("WARNING: %s\n", err) } else { fatal = true - fmt.Printf("ERROR: %s\n", err) + log.Printf("ERROR: %s\n", err) } } return