MCPcopy Create free account
hub / github.com/blues/note / LogInfoPeriodically

Function LogInfoPeriodically

lib/debug.go:263–269  ·  view source on GitHub ↗

LogInfoPeriodically writes an unstructured log message with the INFO level but only periodically

(ctx context.Context, period *LogPeriod, msg string, v ...interface{})

Source from the content-addressed store, hash-verified

261
262// LogInfoPeriodically writes an unstructured log message with the INFO level but only periodically
263func LogInfoPeriodically(ctx context.Context, period *LogPeriod, msg string, v ...interface{}) {
264 if !period.LastLog.IsZero() && time.Since(period.LastLog) < time.Duration(period.PeriodSecs)*time.Second {
265 return
266 }
267 logInfo(ctx, msg, v...)
268 period.LastLog = time.Now()
269}
270
271// LogInfoBumpTrace bumps a trace interval
272func LogInfoBumpTrace(prev *time.Time) (duration time.Duration) {

Callers

nothing calls this directly

Calls 1

logInfoFunction · 0.85

Tested by

no test coverage detected