-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstylesheet.go
More file actions
52 lines (37 loc) · 889 Bytes
/
stylesheet.go
File metadata and controls
52 lines (37 loc) · 889 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
44
45
46
47
48
49
50
51
52
package log
import (
"time"
"github.com/fatih/color"
)
type Color color.Attribute
var (
Cyan Color = Color(color.FgCyan)
White Color = Color(color.FgHiWhite)
Yellow Color = Color(color.FgYellow)
Red Color = Color(color.FgHiRed)
)
type StyleSheet struct {
Colors map[Category]Color
TimeColor Color // color of timestamp
// [=======> ]
BarCaseLeft rune // '['
BarCaseRight rune // ']'
BarLiquid rune // '='
BarVoid rune // ' '
BarHead []rune // { '>' }
HeadOscillation time.Duration // time needed to increment the barhead index
}
var DefaultStyleSheet = StyleSheet{
Colors: map[Category]Color{
"debug": White,
"warn": Yellow,
"error": Red,
},
TimeColor: Cyan,
BarCaseLeft: '[',
BarCaseRight: ']',
BarLiquid: '=',
BarVoid: ' ',
BarHead: []rune{'|', '╱', '─', '╲'},
HeadOscillation: 300 * time.Millisecond,
}