forked from gohouse/gorose
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathlogger_interface.go
More file actions
39 lines (34 loc) · 931 Bytes
/
logger_interface.go
File metadata and controls
39 lines (34 loc) · 931 Bytes
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
package gorose
import (
"time"
"io"
)
// ILogger ...
type ILogger interface {
Sql(sqlStr string, runtime time.Duration)
Slow(sqlStr string, runtime time.Duration)
Error(msg string)
EnableSqlLog() bool
EnableErrorLog() bool
EnableSlowLog() float64
}
// 暂时规划
type ilogger interface {
// Persist 持久化
Persist(w io.Writer)
// Info 常规日志
Info(args ...string)
// Error 错误日志
Error(args ...string)
// Debug 调试日志
Debug(args ...string)
Infof(format string, args ...string)
Errorf(format string, args ...string)
Debugf(format string, args ...string)
InfoWithCtx(ctx interface{}, args ...string)
ErrorWithCtx(ctx interface{}, args ...string)
DebugWithCtx(ctx interface{}, args ...string)
InfofWithCtxf(ctx interface{}, format string, args ...string)
ErrorfWithCtxf(ctx interface{}, format string, args ...string)
DebugfWithCtxf(ctx interface{}, format string, args ...string)
}