refactor(filterlists): Improve index update logging

feat(updates): Add String method
This commit is contained in:
Alexandr Stelnykovych
2025-08-05 15:40:02 +03:00
parent 645438bbf4
commit 878de4ba9d
3 changed files with 6 additions and 2 deletions

View File

@@ -209,7 +209,7 @@ func updateListIndex() error {
)
default:
// List is in cache and current, there is nothing to do.
log.Debug("filterlists: index is up to date")
log.Debugf("filterlists: index is up to date (%s == %s)", index.Version, listIndexUpdate.Version)
// Update the unbreak filter list IDs on initial load.
updateUnbreakFilterListIDs()

View File

@@ -238,7 +238,7 @@ func getUpgradableFiles() ([]*updates.Artifact, error) {
func resolveUpdateOrder(updateOrder []*updates.Artifact) ([]*updates.Artifact, error) {
// sort the update order by ascending version
sort.Sort(byAscVersion(updateOrder))
log.Tracef("intel/filterlists: order of updates: %v", updateOrder)
log.Tracef("intel/filterlists: order of potential updates: %v", updateOrder)
var cacheDBVersion *version.Version
if !isLoaded() {

View File

@@ -59,6 +59,10 @@ func (a *Artifact) SemVer() *semver.Version {
return a.versionNum
}
func (a *Artifact) String() string {
return fmt.Sprintf("%s(v%s)", a.Filename, a.Version)
}
// IsNewerThan returns whether the artifact is newer than the given artifact.
// Returns true if the given artifact is nil.
// The second return value "ok" is false when version could not be compared.