-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.go
46 lines (38 loc) · 1.05 KB
/
main.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
// + build example
package main
import (
"fmt"
"github.com/guumaster/logsymbols"
)
func main() {
fmt.Println("\nAutodetect: ")
fmt.Printf("%s info\n", logsymbols.Info)
fmt.Printf("%s success\n", logsymbols.Ok)
fmt.Printf("%s warning\n", logsymbols.Warning)
fmt.Printf("%s error\n", logsymbols.Error)
// Output:
//
// Autodetect:
// ℹ info
// ✔ success
// ⚠ warning
// ✖ error
logsymbols.ForceNoColors()
fmt.Println("\nwithout-color")
fmt.Println("\tNormal ", logsymbols.NormalSymbols())
fmt.Println("\tFallback", logsymbols.FallbackSymbols())
// Output:
//
// without-color
// Normal Info: ℹ Success: ✔ Warning: ⚠ Error: ✖
// Fallback Info: i Success: √ Warning: ‼ Error: ×
logsymbols.ForceColors()
fmt.Println("\nwith-color")
fmt.Println("\tNormal ", logsymbols.NormalSymbols())
fmt.Println("\tFallback ", logsymbols.FallbackSymbols())
// Output:
//
// with-color
// Normal Info: ℹ Success: ✔ Warning: ⚠ Error: ✖
// Fallback Info: i Success: √ Warning: ‼ Error: ×
}