1
0
mirror of https://github.com/securego/gosec.git synced 2025-01-16 02:33:33 +02:00

Discard the logs messages if the quite flag is set (#200)

This commit is contained in:
cosmincojocar 2018-04-16 11:41:40 +02:00 committed by Grant Murphy
parent 830cb81b29
commit 7790709b81

View File

@ -17,6 +17,7 @@ package main
import (
"flag"
"fmt"
"io/ioutil"
"log"
"os"
"os/user"
@ -275,7 +276,12 @@ func main() {
log.Fatal(e)
}
}
logger = log.New(logWriter, "[gas] ", log.LstdFlags)
if *flagQuiet {
logger = log.New(ioutil.Discard, "", 0)
} else {
logger = log.New(logWriter, "[gas] ", log.LstdFlags)
}
// Load config
config, err := loadConfig(*flagConfig)