From bdb523ece1c979c215130e3901ddc3d55b1f923d Mon Sep 17 00:00:00 2001 From: Felix Frank Date: Sun, 10 Nov 2019 15:21:14 +0100 Subject: [PATCH] lang: funcs: funcgen: Suppress informational messages Send non-error log messages to stdout rather than stderr. Any messages outside the main function are expected to be purely informational. By sending to stdout rather than stderr, they can be discarded during the build. Fixes #568 --- Makefile | 2 +- lang/funcs/funcgen/main.go | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 4904317f..1d6db950 100644 --- a/Makefile +++ b/Makefile @@ -508,6 +508,6 @@ funcgen: lang/funcs/core/generated_funcs.go lang/funcs/core/generated_funcs.go: lang/funcs/funcgen/*.go lang/funcs/core/funcgen.yaml lang/funcs/funcgen/templates/generated_funcs.go.tpl @echo "Generating: funcs..." - @go run `find lang/funcs/funcgen/ -maxdepth 1 -type f -name '*.go' -not -name '*_test.go'` -templates=lang/funcs/funcgen/templates/generated_funcs.go.tpl 2>/dev/null + @go run `find lang/funcs/funcgen/ -maxdepth 1 -type f -name '*.go' -not -name '*_test.go'` -templates=lang/funcs/funcgen/templates/generated_funcs.go.tpl >/dev/null # vim: ts=8 diff --git a/lang/funcs/funcgen/main.go b/lang/funcs/funcgen/main.go index 3d327bb0..e9365a2e 100644 --- a/lang/funcs/funcgen/main.go +++ b/lang/funcs/funcgen/main.go @@ -20,6 +20,7 @@ package main import ( "flag" "log" + "os" ) var ( @@ -34,7 +35,10 @@ func main() { log.Fatalf("No package passed!") } + log.SetOutput(os.Stdout) err := parsePkg(*pkg, *filename, *templates) + log.SetOutput(os.Stderr) + if err != nil { log.Fatal(err) }