MCPcopy Create free account
hub / github.com/TheThingsNetwork/lorawan-stack / LogUpdate

Function LogUpdate

pkg/version/remote.go:261–276  ·  view source on GitHub ↗

LogUpdate logs an Warn level message when there is a newer minor, and a Log level message when there is a newer patch. When there is no new minor or patch version, this function does nothing.

(ctx context.Context, update *Update)

Source from the content-addressed store, hash-verified

259// LogUpdate logs an Warn level message when there is a newer minor, and a Log level message when there is a newer patch.
260// When there is no new minor or patch version, this function does nothing.
261func LogUpdate(ctx context.Context, update *Update) {
262 if update == nil {
263 return
264 }
265 logger := log.FromContext(ctx).WithFields(log.Fields(
266 "current", update.Current,
267 "latest", update.Latest,
268 "docs_url", update.DocsURL,
269 ))
270 switch {
271 case update.Minor:
272 logger.Warn("New minor version available")
273 case update.Patch:
274 logger.Info("New patch version available")
275 }
276}

Callers 1

versionCheckTaskFunction · 0.92

Calls 5

FromContextFunction · 0.92
FieldsFunction · 0.92
WithFieldsMethod · 0.65
WarnMethod · 0.65
InfoMethod · 0.65

Tested by

no test coverage detected