Skip to content

GH-680: Reduced the log level in package manager #774

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 1, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions arduino/cores/packagemanager/package_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -338,20 +338,20 @@ func (pm *PackageManager) GetInstalledPlatformRelease(platform *cores.Platform)
return nil
}

log := func(msg string, pl *cores.PlatformRelease) {
debug := func(msg string, pl *cores.PlatformRelease) {
pm.Log.WithField("bundle", pl.IsIDEBundled).
WithField("version", pl.Version).
WithField("managed", pm.IsManagedPlatformRelease(pl)).
Infof("%s: %s", msg, pl)
Debugf("%s: %s", msg, pl)
}

best := releases[0]
bestIsManaged := pm.IsManagedPlatformRelease(best)
log("current best", best)
debug("current best", best)

for _, candidate := range releases[1:] {
candidateIsManaged := pm.IsManagedPlatformRelease(candidate)
log("candidate", candidate)
debug("candidate", candidate)
// TODO: Disentangle this algorithm and make it more straightforward
if bestIsManaged == candidateIsManaged {
if best.IsIDEBundled == candidate.IsIDEBundled {
Expand All @@ -367,7 +367,7 @@ func (pm *PackageManager) GetInstalledPlatformRelease(platform *cores.Platform)
best = candidate
bestIsManaged = true
}
log("current best", best)
debug("current best", best)
}
return best
}
Expand Down