-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathlog.go
39 lines (32 loc) · 884 Bytes
/
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
package log
import (
"fmt"
)
const (
ColorReset = "\033[0m"
ColorRed = "\033[31m"
ColorGreen = "\033[32m"
ColorBlue = "\033[34m"
ColorYellow = "\033[33m"
ColorWhite = "\033[97m"
)
func Info(msg string, args ...interface{}) {
formatted := fmt.Sprintf(msg, args...)
fmt.Println(ColorWhite, formatted, ColorReset)
}
func Wait(msg string, args ...interface{}) {
formatted := fmt.Sprintf(msg, args...) + "..."
fmt.Println(ColorBlue, formatted, ColorReset)
}
func Good(msg string, args ...interface{}) {
formatted := fmt.Sprintf(msg, args...)
fmt.Println(ColorGreen, formatted, ColorReset)
}
func Warn(msg string, args ...interface{}) {
formatted := fmt.Sprintf(msg, args...)
fmt.Println(ColorYellow, formatted, ColorReset)
}
func Error(msg string, args ...interface{}) {
formatted := fmt.Sprintf(msg, args...)
fmt.Println(ColorRed, formatted, ColorReset)
}