-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtypes.go
59 lines (50 loc) · 1.1 KB
/
types.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
47
48
49
50
51
52
53
54
55
56
57
58
59
package logsymbols
import (
"fmt"
)
var colorOn bool
type Symbol string
var (
// Info represents the information symbol
Info Symbol
// Success represents the success symbol
Success Symbol
// Ok alias of Success
Ok Symbol
// Warning represents the warning symbol
Warning Symbol
// Warn alias of Warning
Warn Symbol
// Error represents the error symbol
Error Symbol
)
// Symbols struct contains all symbols
type Symbols struct {
Info Symbol
Success Symbol
Ok Symbol
Warning Symbol
Warn Symbol
Error Symbol
}
var osBaseSymbols Symbols
var normal = Symbols{
Info: Symbol("ℹ"),
Success: Symbol("✔"),
Ok: Symbol("✔"),
Warning: Symbol("⚠"),
Warn: Symbol("⚠"),
Error: Symbol("✖"),
}
var fallback = Symbols{
Info: Symbol("i"),
Success: Symbol("√"),
Ok: Symbol("√"),
Warning: Symbol("‼"),
Warn: Symbol("‼"),
Error: Symbol("×"),
}
// String returns a printable representation of Symbols struct
func (s Symbols) String() string {
return fmt.Sprintf("Info: %s Success: %s Warning: %s Error: %s", s.Info, s.Success, s.Warning, s.Error)
}