-
Notifications
You must be signed in to change notification settings - Fork 1
/
types.go
executable file
·70 lines (57 loc) · 1004 Bytes
/
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
60
61
62
63
64
65
66
67
68
69
70
package logger
import (
"io"
"log"
)
type Log interface {
SetLevel(int)
SetDepth(int)
Debug(...interface{})
Debugn(...interface{})
Debugf(string, ...interface{})
Info(...interface{})
Infon(...interface{})
Infof(string, ...interface{})
Warn(...interface{})
Warnn(...interface{})
Warnf(string, ...interface{})
Error(...interface{})
Errorn(...interface{})
Errorf(string, ...interface{})
Fatal(...interface{})
Fataln(...interface{})
Fatalf(string, ...interface{})
Panic(...interface{})
Panicn(...interface{})
Panicf(string, ...interface{})
}
const (
DEBUG = iota
INFO
WARN
ERROR
FATAL
PANIC
)
const (
tagInfo = "INFO: "
tagWarn = "WARN: "
tagError = "ERROR: "
tagFatal = "FATAL: "
tagPanic = "PANIC: "
tagDebug = "DEBUG: "
)
const (
flags = log.Ldate | log.Ltime | log.Lshortfile
)
type logger struct {
level int
depth int
wc io.Writer
dlog *log.Logger
ilog *log.Logger
wlog *log.Logger
elog *log.Logger
flog *log.Logger
plog *log.Logger
}