/
logger.go
37 lines (32 loc) · 1.09 KB
/
logger.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
package log
//go:generate mockgen -destination=mock/logger.go -package=logmock -source=logger.go
// LogLevel defines log level
type LogLevel int
const (
TraceLevel LogLevel = iota
DebugLevel
InfoLevel
WarnLevel
ErrorLevel
FatalLevel
PanicLevel
)
// Logger defines generic interface for all logger.
type Logger interface {
Trace(msg string, args ...interface{})
Tracew(msg string, md Metadata, args ...interface{})
Debug(msg string, args ...interface{})
Debugw(msg string, md Metadata, args ...interface{})
Info(msg string, args ...interface{})
Infow(msg string, md Metadata, args ...interface{})
Warn(msg string, args ...interface{})
Warnw(msg string, md Metadata, args ...interface{})
Error(msg string, args ...interface{})
Errorw(msg string, md Metadata, args ...interface{})
Fatal(msg string, args ...interface{})
Fatalw(msg string, md Metadata, args ...interface{})
Panic(msg string, args ...interface{})
Panicw(msg string, md Metadata, args ...interface{})
Log(level LogLevel, msg string, args ...interface{})
Logw(level LogLevel, msg string, md Metadata, args ...interface{})
}