forked from goal-web/contracts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlogger.go
39 lines (30 loc) · 1.02 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
38
39
package contracts
type Logger interface {
// WithFields 添加数据
// adding data
WithFields(fields Fields) Logger
// WithField 通过给定的key value 添加数据
// Add data by given key value.
WithField(key string, value interface{}) Logger
// WithError 添加错误
// add error.
WithError(err error) Logger
// WithException 将异常管理委托给自定义异常处理程序
// Delegate exception management to a custom exception handler.
WithException(exception Exception) Logger
// Info 在 INFO 级别添加日志记录
// Adds a log record at the INFO level.
Info(msg string)
// Warn 在 WARNING 级别添加日志记录
// Adds a log record at the WARNING level.
Warn(msg string)
// Debug 在 DEBUG 级别添加日志记录
// Adds a log record at the DEBUG level.
Debug(msg string)
// Error 在 ERROR 级别添加日志记录
// Adds a log record at the ERROR level.
Error(msg string)
// Fatal 在 FATAL 级别添加日志记录
// Adds a log record at the FATAL level.
Fatal(msg string)
}