-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathlog.go
46 lines (35 loc) · 1.11 KB
/
log.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
package log
import (
"github.com/fatih/color"
"manticore-cli/classes"
"strconv"
)
func PrintDescription(out string) {
color.Yellow("%s", out)
}
func printStdOut(out string) {
color.Green("%s", out)
}
func PrintStdErr(err string) {
color.Red("%s", err)
}
func PrintFunc(err string) {
color.White("%s", err)
}
func printInfo(out string) {
color.Blue("%s", out)
}
func PrintScenariosOutput(scenariosOutput []classes.ScenarioOutput) {
for _, row := range scenariosOutput {
printInfo("=============================================================================\n")
PrintFunc("ID :" + row.Id)
PrintFunc("Name : " + row.Name)
PrintFunc("Description : " + row.Description)
printInfo("=============================================================================\n")
printInfo("Scenario Command : " + row.ScenarioCommand)
printStdOut("Scenario Output : " + row.ScenarioOutput)
PrintStdErr("Scenario StdErr: " + row.ScenarioErr)
PrintDescription("Scenario Result: " + strconv.FormatBool(row.ScenarioResult))
printInfo("=============================================================================\n")
}
}