-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathpriority.go
95 lines (87 loc) · 936 Bytes
/
priority.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
package syslog
type Facility byte
const (
Kern Facility = iota
User
Mail
Daemon
Auth
Syslog
Lpr
News
Uucp
Cron
Authpriv
System0
System1
System2
System3
System4
Local0
Local1
Local2
Local3
Local4
Local5
Local6
Local7
)
var facToStr = [...]string{
"kern",
"user",
"mail",
"daemon",
"auth",
"syslog",
"lpr",
"news",
"uucp",
"cron",
"authpriv",
"system0",
"system1",
"system2",
"system3",
"system4",
"local0",
"local1",
"local2",
"local3",
"local4",
"local5",
"local6",
"local7",
}
func (f Facility) String() string {
if f > Local7 {
return "unknown"
}
return facToStr[f]
}
type Severity byte
const (
Emerg Severity = iota
Alert
Crit
Err
Warning
Notice
Info
Debug
)
var sevToStr = [...]string{
"emerg",
"alert",
"crit",
"err",
"waining",
"notice",
"info",
"debug",
}
func (s Severity) String() string {
if s > Debug {
return "unknown"
}
return sevToStr[s]
}