-
Notifications
You must be signed in to change notification settings - Fork 0
/
iterface.go
40 lines (36 loc) · 1.16 KB
/
iterface.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
package logx
import "io"
type Fields map[string]interface{}
type ILogger interface {
Debug(args ...interface{})
Debugf(format string, args ...interface{})
Info(args ...interface{})
Infof(format string, args ...interface{})
Warn(args ...interface{})
Warnf(format string, args ...interface{})
Error(args ...interface{})
Errorf(format string, args ...interface{})
Panic(args ...interface{})
Panicf(format string, args ...interface{})
Fatal(args ...interface{})
Fatalf(format string, args ...interface{})
WithFields(fields Fields) ILogger
WithField(key string, value interface{}) ILogger
WithKVs(kvs ...interface{}) ILogger
WithError(err error) ILogger
Output() io.Writer
}
const (
//DebugLevel has verbose message
DebugLevel = "debug"
//InfoLevel is default log level
InfoLevel = "info"
//WarnLevel is for logging messages about possible issues
WarnLevel = "warn"
//ErrorLevel is for logging errors
ErrorLevel = "error"
////FatalLevel is for logging fatal messages. The system shutdowns after logging the message.
//FatalLevel = "fatal"
////PanicLevel is for logging panic messages. The system panics after logging the message.
//PanicLevel = "panic"
)