From 936aec757ead25829b8f034def66dbf4adb7707b Mon Sep 17 00:00:00 2001 From: Martin Czygan Date: Wed, 19 May 2021 01:35:17 +0200 Subject: do not fail on partial input; extend logging --- skate/cmd/skate-reduce/main.go | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'skate/cmd/skate-reduce') diff --git a/skate/cmd/skate-reduce/main.go b/skate/cmd/skate-reduce/main.go index 6c69121..eb84e38 100644 --- a/skate/cmd/skate-reduce/main.go +++ b/skate/cmd/skate-reduce/main.go @@ -55,6 +55,7 @@ var ( batchSize = flag.Int("b", 10000, "batch size") mode = flag.String("m", "ref", "mode, e.g. exact, verify, ref, bref, wiki") quite = flag.Bool("q", false, "be quite") + logFile = flag.String("log", "", "log filename") // Possible inputs -- we could switch to a subcommand cli parser? refs = flag.String("F", "", "path to refs input") @@ -74,6 +75,14 @@ var ( func main() { flag.Parse() + if *logFile != "" { + f, err := os.OpenFile(*logFile, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644) + if err != nil { + log.Fatal(err) + } + defer f.Close() + log.SetOutput(f) + } if *quite { log.SetOutput(ioutil.Discard) } -- cgit v1.2.3