MCPcopy Create free account
hub / github.com/OpenAtomFoundation/SmartIDE / isRepeat

Function isRepeat

cli/pkg/common/log.go:68–85  ·  view source on GitHub ↗
(message string, level zapcore.Level)

Source from the content-addressed store, hash-verified

66var _lastMsg lastMsg
67
68func 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
87func (sLog *smartIDELogStruct) InitLogger(logLevel string) {
88 if strings.ToLower(strings.TrimSpace(logLevel)) == "debug" {

Callers 3

InfoMethod · 0.85
DebugMethod · 0.85
ImportanceMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected