forked from novacloudcz/goclitools
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlog.go
More file actions
43 lines (36 loc) · 703 Bytes
/
log.go
File metadata and controls
43 lines (36 loc) · 703 Bytes
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
package goclitools
import (
"fmt"
"strings"
)
// Log ...
func Log(m ...interface{}) {
fmt.Println(m...)
}
// Logf ...
func Logf(f string, m ...interface{}) {
fmt.Printf(f, m...)
}
// LogSection ...
func LogSection(title string, m ...interface{}) {
header := fmt.Sprintf("==== %s ====", title)
fmt.Println("\n" + header)
fmt.Println(strings.Repeat("=", len(header)))
if len(m) > 0 {
fmt.Print("\n")
fmt.Println(m...)
fmt.Println(strings.Repeat("=", len(header)))
}
}
// PrintChecking ...
func PrintChecking(message string) {
fmt.Print("checking " + message + ": ")
}
// PrintNotOK ...
func PrintNotOK() {
fmt.Println("✘")
}
// PrintOK ...
func PrintOK() {
fmt.Println("✓")
}