(message string, level zapcore.Level)
| 66 | var _lastMsg lastMsg |
| 67 | |
| 68 | func isRepeat(message string, level zapcore.Level) bool { |
| 69 | repeat := false |
| 70 | fmt.Sprintln(time.Since(_lastMsg.CreateTime)) |
| 71 | if (_lastMsg != lastMsg{}) && message != "" && |
| 72 | message == _lastMsg.Message && level == _lastMsg.Level { |
| 73 | if _lastMsg.TimeOut < 0 || (_lastMsg.TimeOut >= 0 && time.Since(_lastMsg.CreateTime) <= _lastMsg.TimeOut) { |
| 74 | repeat = true |
| 75 | } |
| 76 | |
| 77 | } |
| 78 | |
| 79 | if !repeat { |
| 80 | _lastMsg = lastMsg{Message: message, CreateTime: time.Now(), TimeOut: time.Minute * 10, Level: level} |
| 81 | |
| 82 | } |
| 83 | |
| 84 | return repeat |
| 85 | } |
| 86 | |
| 87 | func (sLog *smartIDELogStruct) InitLogger(logLevel string) { |
| 88 | if strings.ToLower(strings.TrimSpace(logLevel)) == "debug" { |
no outgoing calls
no test coverage detected