From dadf09da2e228787eeea71451b937c2639ef31d5 Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Thu, 28 Nov 2024 14:53:35 +0100 Subject: [PATCH] cmd/zoekt: suppress logging if -v is missing (#869) The logging is neat for debugging, but is distracting when using cmd/zoekt as a grep replacement. --- cmd/zoekt/main.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmd/zoekt/main.go b/cmd/zoekt/main.go index 3f11a195..f513c320 100644 --- a/cmd/zoekt/main.go +++ b/cmd/zoekt/main.go @@ -177,6 +177,10 @@ func main() { } pat := flag.Arg(0) + if !*verbose { + log.SetOutput(io.Discard) + } + var searcher zoekt.Searcher var err error if *shard != "" {