aboutsummaryrefslogtreecommitdiffstats
path: root/skate/cmd
diff options
context:
space:
mode:
authorMartin Czygan <martin.czygan@gmail.com>2021-06-15 05:55:10 +0200
committerMartin Czygan <martin.czygan@gmail.com>2021-06-15 05:55:10 +0200
commit74b2181786fd033a1e860017d05b0d88976d4c07 (patch)
tree7eb821250a4fca7db4d06a4b478c36e8e4981fe1 /skate/cmd
parent735cbc2c774e5373b48d2c635891372faa1c4127 (diff)
downloadrefcat-74b2181786fd033a1e860017d05b0d88976d4c07.tar.gz
refcat-74b2181786fd033a1e860017d05b0d88976d4c07.zip
compress log file
Diffstat (limited to 'skate/cmd')
-rw-r--r--skate/cmd/skate-reduce/main.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/skate/cmd/skate-reduce/main.go b/skate/cmd/skate-reduce/main.go
index 74da648..3130a22 100644
--- a/skate/cmd/skate-reduce/main.go
+++ b/skate/cmd/skate-reduce/main.go
@@ -68,6 +68,7 @@ import (
"git.archive.org/martin/cgraph/skate"
"git.archive.org/martin/cgraph/skate/parallel"
"git.archive.org/martin/cgraph/skate/xio"
+ gzip "github.com/klauspost/compress/gzip"
)
var (
@@ -75,7 +76,7 @@ var (
batchSize = flag.Int("b", 10000, "batch size")
mode = flag.String("m", "ref", "mode, e.g. exact, fuzzy, ref, bref, wiki, oled, oledt, unmatched")
quite = flag.Bool("q", false, "be quite")
- logFile = flag.String("log", "", "log filename (stderr, if empty)")
+ logFile = flag.String("log", "", "log filename (stderr, if empty; logfile will be gzip compressed)")
// Possible inputs -- we could switch to a subcommand cli parser?
bref = flag.String("B", "", "path to bref file")
@@ -103,8 +104,10 @@ func main() {
if err != nil {
log.Fatal(err)
}
+ gzw := gzip.NewWriter(f)
+ defer gzw.Flush()
defer f.Close()
- log.SetOutput(f)
+ log.SetOutput(gzw)
}
if *quite {
log.SetOutput(ioutil.Discard)