adding log_level option
This commit is contained in:
12
main.go
12
main.go
@@ -96,10 +96,20 @@ func main() {
|
||||
issues = append(issues, rprt)
|
||||
}
|
||||
|
||||
//this is better printing, it should probably group up the port issues in a better printing. Not sure how
|
||||
lvl := os.Getenv("LOG_LEVEL")
|
||||
for _, p := range issues {
|
||||
fmt.Println()
|
||||
fmt.Println("----------------------------------------------------------------------------")
|
||||
fmt.Println(p.Name)
|
||||
for _, x := range p.Issues {
|
||||
fmt.Println(*x)
|
||||
if lvl == "all" {
|
||||
fmt.Printf("\tsafe: %t\n\tlevel: %s\n\tMessages:\n\t\t%s\n\n", x.Safe, x.Level, strings.Join(x.Messages, "\n\t\t"))
|
||||
} else if lvl == "fatal" {
|
||||
if x.Level == issue.FATAL {
|
||||
fmt.Printf("\tsafe: %t\n\tlevel: %s\n\tMessages:\n\t\t%s\n\n", x.Safe, x.Level, strings.Join(x.Messages, "\n\t\t"))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user