aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--skate/cmd/skate-reduce/main.go7
-rw-r--r--skate/go.mod1
-rw-r--r--skate/go.sum3
3 files changed, 9 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)
diff --git a/skate/go.mod b/skate/go.mod
index 88a992d..11361f3 100644
--- a/skate/go.mod
+++ b/skate/go.mod
@@ -6,6 +6,7 @@ require (
github.com/adrg/xdg v0.3.3
github.com/elastic/go-elasticsearch v0.0.0
github.com/elastic/go-elasticsearch/v7 v7.12.0
+ github.com/klauspost/compress v1.13.1
github.com/klauspost/cpuid/v2 v2.0.6 // indirect
github.com/kr/pretty v0.1.0
github.com/matryer/is v1.4.0
diff --git a/skate/go.sum b/skate/go.sum
index da37d40..d19d588 100644
--- a/skate/go.sum
+++ b/skate/go.sum
@@ -6,6 +6,9 @@ github.com/elastic/go-elasticsearch v0.0.0 h1:Pd5fqOuBxKxv83b0+xOAJDAkziWYwFinWn
github.com/elastic/go-elasticsearch v0.0.0/go.mod h1:TkBSJBuTyFdBnrNqoPc54FN0vKf5c04IdM4zuStJ7xg=
github.com/elastic/go-elasticsearch/v7 v7.12.0 h1:j4tvcMrZJLp39L2NYvBb7f+lHKPqPHSL3nvB8+/DV+s=
github.com/elastic/go-elasticsearch/v7 v7.12.0/go.mod h1:OJ4wdbtDNk5g503kvlHLyErCgQwwzmDtaFC4XyOxXA4=
+github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
+github.com/klauspost/compress v1.13.1 h1:wXr2uRxZTJXHLly6qhJabee5JqIhTRoLBhDOA74hDEQ=
+github.com/klauspost/compress v1.13.1/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg=
github.com/klauspost/cpuid/v2 v2.0.5/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg=
github.com/klauspost/cpuid/v2 v2.0.6 h1:dQ5ueTiftKxp0gyjKSx5+8BtPWkyQbd95m8Gys/RarI=
github.com/klauspost/cpuid/v2 v2.0.6/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg=