adding log_level option

This commit is contained in:
2025-11-11 16:27:26 -05:00
parent a0e397a87f
commit 90d2037563
2 changed files with 15 additions and 4 deletions

12
main.go
View File

@@ -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"))
}
}
}
}
}