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
This commit is contained in:
committed by
James Shubin
parent
164a9479ad
commit
bdb523ece1
2
Makefile
2
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
|
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..."
|
@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
|
# vim: ts=8
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ package main
|
|||||||
import (
|
import (
|
||||||
"flag"
|
"flag"
|
||||||
"log"
|
"log"
|
||||||
|
"os"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@@ -34,7 +35,10 @@ func main() {
|
|||||||
log.Fatalf("No package passed!")
|
log.Fatalf("No package passed!")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
log.SetOutput(os.Stdout)
|
||||||
err := parsePkg(*pkg, *filename, *templates)
|
err := parsePkg(*pkg, *filename, *templates)
|
||||||
|
log.SetOutput(os.Stderr)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user