-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathlog.go
51 lines (41 loc) · 1006 Bytes
/
log.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
45
46
47
48
49
50
51
package rocketmq
import (
"github.com/astaxie/beego/logs"
)
var (
defaultLog *logs.BeeLogger
logger *logs.BeeLogger
)
func init() {
defaultLog = logs.NewLogger(10000)
defaultLog.SetLogger("console", "")
logger = defaultLog
}
// SetLog 日志函数
func SetLog(log *logs.BeeLogger) {
logger = log
}
// Trace 打印trace级别日志
func Trace(format string, args ...interface{}) {
logger.Trace(format, args...)
}
// Debug 打印debug级别日志
func Debug(format string, args ...interface{}) {
logger.Debug(format, args...)
}
// Info 打印info级别日志
func Info(format string, args ...interface{}) {
logger.Info(format, args...)
}
// Warn 打印warn级别日志
func Warn(format string, args ...interface{}) {
logger.Warn(format, args...)
}
// Error 打印error级别日志
func Error(format string, args ...interface{}) {
logger.Error(format, args...)
}
// Fatal 打印critial级别日志
func Fatal(format string, args ...interface{}) {
logger.Critical(format, args...)
}