-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathentry.go
More file actions
62 lines (56 loc) · 1.57 KB
/
Copy pathentry.go
File metadata and controls
62 lines (56 loc) · 1.57 KB
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
package alog
// A Timestamp marks the time when an entry was put to a log.
type Timestamp struct {
Seconds int32 // Seconds since the epoch
Nanoseconds int32 // Nanoseconds since the epoch
}
// A Tag describes the origin of an Entry.
type Tag string
// A Priority models the log priority of a single Entry.
type Priority int
// String returns a Priority as a string (short code).
func (self Priority) String() string {
switch self {
default:
return "U"
case PriorityUnknown:
return "U"
case PriorityDefault:
return "D"
case PriorityVerbose:
return "V"
case PriorityDebug:
return "D"
case PriorityInfo:
return "I"
case PriorityWarn:
return "W"
case PriorityError:
return "E"
case PriorityFatal:
return "F"
case PrioritySilent:
return "S"
}
}
const (
PriorityUnknown Priority = 0
PriorityDefault Priority = 1
PriorityVerbose Priority = 2
PriorityDebug Priority = 3
PriorityInfo Priority = 4
PriorityWarn Priority = 5
PriorityError Priority = 6
PriorityFatal Priority = 7
PrioritySilent Priority = 8
)
// An Entry models an individual log message.
type Entry struct {
Pid int32 // Generating process's ID
Tid int32 // Generating thread's ID
When Timestamp // When the entry was logged
Priority Priority // Priority of the message
Tag Tag // Tag describing the origin of the message
Message string // The actual message of the Entry
Ext map[string]interface{} // Vendor specific extensions to individual entries
}