mirror of
https://github.com/securego/gosec.git
synced 2024-11-05 19:45:51 +00:00
Sending log messages to multiple streams
Use the configured logger for all log messages.
This commit is contained in:
parent
51b4a4ddc8
commit
5361949a13
1 changed files with 5 additions and 5 deletions
|
@ -125,19 +125,19 @@ func loadConfig(configFile string) (gas.Config, error) {
|
|||
func loadRules(include, exclude string) rules.RuleList {
|
||||
var filters []rules.RuleFilter
|
||||
if include != "" {
|
||||
log.Printf("including rules: %s", include)
|
||||
logger.Printf("including rules: %s", include)
|
||||
including := strings.Split(include, ",")
|
||||
filters = append(filters, rules.NewRuleFilter(false, including...))
|
||||
} else {
|
||||
log.Println("including rules: default")
|
||||
logger.Println("including rules: default")
|
||||
}
|
||||
|
||||
if exclude != "" {
|
||||
log.Printf("excluding rules: %s", exclude)
|
||||
logger.Printf("excluding rules: %s", exclude)
|
||||
excluding := strings.Split(exclude, ",")
|
||||
filters = append(filters, rules.NewRuleFilter(true, excluding...))
|
||||
} else {
|
||||
log.Println("excluding rules: default")
|
||||
logger.Println("excluding rules: default")
|
||||
}
|
||||
return rules.Generate(filters...)
|
||||
}
|
||||
|
@ -192,7 +192,7 @@ func main() {
|
|||
// Load enabled rule definitions
|
||||
ruleDefinitions := loadRules(*flagRulesInclude, *flagRulesExclude)
|
||||
if len(ruleDefinitions) <= 0 {
|
||||
log.Fatal("cannot continue: no rules are configured.")
|
||||
logger.Fatal("cannot continue: no rules are configured.")
|
||||
}
|
||||
|
||||
// Create the analyzer
|
||||
|
|
Loading…
Reference in a new issue