diff options
-rw-r--r-- | skate/cmd/skate-reduce/main.go | 9 | ||||
-rw-r--r-- | skate/zippy.go | 8 |
2 files changed, 13 insertions, 4 deletions
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) } diff --git a/skate/zippy.go b/skate/zippy.go index 237162f..db64ad1 100644 --- a/skate/zippy.go +++ b/skate/zippy.go @@ -40,13 +40,13 @@ func ZippyExact(releases, refs io.Reader, matchResult MatchResult, w io.Writer) return nil } if target, err = stringToRelease(cut(g.G0[0], "\t", 2)); err != nil { - groupLogf(g, "failed to parse release: %v", err) - return err + groupLogf(g, "[skip] failed to parse release: %v", err) + continue } for _, line := range g.G1 { if ref, err = stringToRef(cut(line, "\t", 2)); err != nil { - groupLogf(g, "failed to parse ref: %v", err) - return err + groupLogf(g, "[skip] failed to parse ref: %v", err) + continue } var bref BiblioRef bref.SourceReleaseIdent = ref.ReleaseIdent |