Skip to content

Commit

Permalink
cmd/zoekt: Suppress warning messages when verbose flag is not set
Browse files Browse the repository at this point in the history
For using zoekt as grep

Fixes google#42

Change-Id: Iba86004b822833fc07d2f22c3e5dcac4d6dc376f
  • Loading branch information
mattn authored and hanwen committed Jan 25, 2018
1 parent 7444844 commit 1e42ec5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion cmd/zoekt/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,9 @@ func main() {
log.Fatal(err)
}
defer f.Close()
log.Println("Displaying matches...")
if *verbose {
log.Println("Displaying matches...")
}
pprof.StartCPUProfile(f)
for i := 0; i < 10; i++ {
sres, err = searcher.Search(context.Background(), query, &sOpts)
Expand Down
2 changes: 1 addition & 1 deletion shards/shards.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ func (tl *throttledLoader) load(key string) {
tl.throttle <- struct{}{}
shard, err := loadShard(key)
<-tl.throttle
log.Printf("reloading: %s, err %v ", key, err)
if err != nil {
log.Printf("reloading: %s, err %v ", key, err)
return
}

Expand Down

0 comments on commit 1e42ec5

Please sign in to comment.