Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
stavros-k committed Apr 3, 2024
1 parent 0505413 commit 5b1d8b3
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions check_health.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ func main() {
// Spin go routines to check each container
for _, c := range containers {
wg.Add(1)
fmt.Print("Watching ", getContainerName(c.Names), " ... ")
fmt.Printf("Watching [%s] ...\n", getContainerName(c.Names))
go func(c d_types.Container) {
defer wg.Done()
checkContainer(c, checksCh)
Expand All @@ -103,20 +103,22 @@ func main() {

// Print the results
for name, res := range checkResults {
fmt.Println(strings.Repeat("=", 20), name, strings.Repeat("=", 20))
fmt.Println(strings.Repeat("=", 50), name, strings.Repeat("=", 20))
fmt.Printf("Container: %s\n", name)
fmt.Printf("Healthy: %t\n", res.Healthy)
fmt.Printf("Fatal: %t\n", res.Fatal)
if res.Logs != "" {
fmt.Printf("Logs: %s\n\n", res.Logs)
fmt.Printf("Logs: %s\n", res.Logs)
} else {
fmt.Println("Logs: No logs available")
}
fmt.Println(strings.Repeat("=", 40+len(name)))
if res.Fatal {
unhealthy++
fmt.Printf("Probe Logs: %s\n\n", res.ProbeLogs)
if res.ProbeLogs != "" {
fmt.Printf("Probe Logs: %s\n", res.ProbeLogs)
}
}
fmt.Println(strings.Repeat("=", 100+len(name)))
}

fmt.Println("Summary:")
Expand Down

0 comments on commit 5b1d8b3

Please sign in to comment.