Skip to content

Commit

Permalink
Clearer logging in self-update (#28)
Browse files Browse the repository at this point in the history
The old logging appeared as:

```
I0307 15:41:31.709551       3 update.go:100] Installed (os: 0.3.1709825047-incompatible applet: 0.3.1709823315-incompatible)
I0307 15:41:31.721181       3 update.go:101] Updates (os: 0.3.1709825047-incompatible applet: 0.3.1709823315-incompatible)
```

This takes up two lines on a regular schedule, and looks like it is performing an operation.
This logging has now been moved to only when no updates are applied and takes a single line.

When an update is being applied, we still get an entry that says `Upgrading OS/applet from X to Y`.
  • Loading branch information
mhutchinson authored Mar 11, 2024
1 parent c1f020c commit 95b64a0
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions release/firmware/update/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,6 @@ func (u Updater) Update(ctx context.Context) error {
return fmt.Errorf("failed to get latest versions: %v", err)
}

klog.Infof("Installed (os: %v applet: %v)", u.osVer, u.appVer)
klog.Infof("Updates (os: %v applet: %v)", osVer, appVer)
if u.osVer.LessThan(osVer) {
klog.Infof("Upgrading OS from %q to %q", u.osVer, osVer)
bundle, err := u.remote.GetOS(ctx)
Expand All @@ -125,5 +123,6 @@ func (u Updater) Update(ctx context.Context) error {
return fmt.Errorf("failed to install applet firmware: %v", err)
}
}
klog.Infof("Self-update: no updates applied (os: %v applet: %v)", u.osVer, u.appVer)
return nil
}

0 comments on commit 95b64a0

Please sign in to comment.