/
interface.go
44 lines (35 loc) · 1.14 KB
/
interface.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
package logger
import (
"context"
"github.com/hhq163/logger/core"
)
// 通用日志接口定义
type Logger interface {
SetLevel(level core.Level)
GetLevel() core.Level
With(args ...interface{}) Logger
Debug(args ...interface{})
Info(args ...interface{})
Warn(args ...interface{})
Error(args ...interface{})
DPanic(args ...interface{})
Panic(args ...interface{})
Fatal(args ...interface{})
Debugf(template string, args ...interface{})
Infof(template string, args ...interface{})
Warnf(template string, args ...interface{})
Errorf(template string, args ...interface{})
DPanicf(template string, args ...interface{})
Panicf(template string, args ...interface{})
Fatalf(template string, args ...interface{})
Debugw(msg string, keysAndValues ...interface{})
Infow(msg string, keysAndValues ...interface{})
Warnw(msg string, keysAndValues ...interface{})
Errorw(msg string, keysAndValues ...interface{})
DPanicw(msg string, keysAndValues ...interface{})
Panicw(msg string, keysAndValues ...interface{})
Fatalw(msg string, keysAndValues ...interface{})
Sync() error
WithSpan(ctx context.Context) Logger
WithCtx(ctx context.Context) Logger
}