1
0
mirror of https://github.com/securego/gosec.git synced 2025-11-25 22:22:17 +02:00

Reduce logging messages a tad

Only need to log if we're skipping a file or if we're processing it.
Should also use the [gas] prefix to aid filtering.
This commit is contained in:
Grant Murphy
2016-12-02 15:34:12 -08:00
parent 465338b05b
commit 1ba8b93565
2 changed files with 9 additions and 9 deletions

13
main.go
View File

@@ -167,12 +167,12 @@ func main() {
tools := newUtils()
flag.Var(tools, "tool", "GAS utilities to assist with rule development")
// Setup logging
logger = log.New(os.Stderr, "[gas] ", log.LstdFlags)
// Parse command line arguments
flag.Parse()
// Setup logging
logger = log.New(os.Stderr, "[gas]", log.LstdFlags)
// Ensure at least one file was specified
if flag.NArg() == 0 {
@@ -195,6 +195,7 @@ func main() {
toAnalyze := getFilesToAnalyze(flag.Args(), excluded)
for _, file := range toAnalyze {
logger.Printf("scanning \"%s\"\n", file)
if err := analyzer.Process(file); err != nil {
logger.Fatal(err)
}
@@ -226,10 +227,10 @@ func main() {
// getFilesToAnalyze lists all files
func getFilesToAnalyze(paths []string, excluded *fileList) []string {
log.Println("getFilesToAnalyze: start")
//log.Println("getFilesToAnalyze: start")
var toAnalyze []string
for _, path := range paths {
log.Printf("getFilesToAnalyze: processing \"%s\"\n", path)
//log.Printf("getFilesToAnalyze: processing \"%s\"\n", path)
// get the absolute path before doing anything else
path, err := filepath.Abs(path)
if err != nil {
@@ -257,7 +258,7 @@ func getFilesToAnalyze(paths []string, excluded *fileList) []string {
}
}
}
log.Println("getFilesToAnalyze: end")
//log.Println("getFilesToAnalyze: end")
return toAnalyze
}