-
Notifications
You must be signed in to change notification settings - Fork 0
/
Monitor.go
27 lines (23 loc) · 835 Bytes
/
Monitor.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
package log
import (
"github.com/ssgo/standard"
)
func (logger *Logger) Monitor(name, target, targetInfo, expect, result string, succeed bool, usedTime float32, memo string, extra ...interface{}) {
if !logger.CheckLevel(INFO) {
return
}
logger.Log(logger.MakeMonitorLog(standard.LogTypeMonitor, name, target, targetInfo, expect, result, succeed, usedTime, memo, extra...))
}
func (logger *Logger) MakeMonitorLog(logType, name, target, targetInfo, expect, result string, succeed bool, usedTime float32, memo string, extra ...interface{}) standard.MonitorLog {
return standard.MonitorLog{
BaseLog: logger.MakeBaseLog(logType, extra...),
Name: name,
Target: target,
TargetInfo: targetInfo,
Expect: expect,
Result: result,
Succeed: succeed,
UsedTime: usedTime,
Memo: memo,
}
}