Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 22 additions & 6 deletions pkg/results/construction_results.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,34 @@ type CheckConstructionResults struct {

// Print logs CheckConstructionResults to the console.
func (c *CheckConstructionResults) Print() {
fmt.Println()
fmt.Println("========================================")

if len(c.Error) > 0 {
fmt.Printf("\n")
color.Red("Error: %s", c.Error)
color.Red("STATUS: FAILED")
fmt.Println()
color.Yellow("Error Details:")
fmt.Printf(" %s\n", c.Error)
fmt.Println()
color.Cyan("Suggested Actions:")
fmt.Println(" 1. Review the error message above")
fmt.Println(" 2. Check your construction configuration")
fmt.Println(" 3. Verify the Rosetta server is accessible")
fmt.Println(" 4. Run with --help for more options")
} else {
fmt.Printf("\n")
color.Green("Success: %s", types.PrintStruct(c.EndConditions))
color.Green("STATUS: SUCCESS")
fmt.Println()
color.Cyan("Construction check completed successfully!")
fmt.Printf("End Conditions: %s\n", types.PrintStruct(c.EndConditions))
}

fmt.Println()
fmt.Println("========================================")
fmt.Println()

fmt.Printf("\n")
if c.Stats != nil {
c.Stats.Print()
fmt.Printf("\n")
fmt.Println()
}
}

Expand Down
38 changes: 30 additions & 8 deletions pkg/results/data_results.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,24 +65,46 @@ type CheckDataResults struct {

// Print logs CheckDataResults to the console.
func (c *CheckDataResults) Print() {
fmt.Println()
fmt.Println("========================================")

if len(c.Error) > 0 {
fmt.Printf("\n")
color.Red("Error: %s", c.Error)
}
color.Red("STATUS: FAILED")
fmt.Println()
color.Yellow("Error Details:")
fmt.Printf(" %s\n", c.Error)
fmt.Println()
color.Cyan("Suggested Actions:")
fmt.Println(" 1. Review the error message above")
fmt.Println(" 2. Check your configuration file")
fmt.Println(" 3. Verify the Rosetta server is accessible")
fmt.Println(" 4. Run with --help for more options")
} else {
color.Green("STATUS: SUCCESS")
fmt.Println()
color.Cyan("All checks passed successfully!")
}

fmt.Println()
fmt.Println("========================================")
fmt.Println()

if c.EndCondition != nil {
fmt.Printf("\n")
color.Green("Success: %s [%s]", c.EndCondition.Type, c.EndCondition.Detail)
fmt.Println("End Condition:")
fmt.Printf(" Type: %s\n", c.EndCondition.Type)
if len(c.EndCondition.Detail) > 0 {
fmt.Printf(" Detail: %s\n", c.EndCondition.Detail)
}
fmt.Println()
}

fmt.Printf("\n")
if c.Tests != nil {
c.Tests.Print()
fmt.Printf("\n")
fmt.Println()
}
if c.Stats != nil {
c.Stats.Print()
fmt.Printf("\n")
fmt.Println()
}
}

Expand Down