From 30f0e0dabf52d41702e3ae1743f2377019b68510 Mon Sep 17 00:00:00 2001 From: Ophestra Date: Tue, 1 Sep 2026 21:54:02 +0900 Subject: pkg: silence collection verbose messages This is a pseudo-artifact, these messages provide no meaningful information. Signed-off-by: Ophestra --- pkg/pkg.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'pkg') diff --git a/pkg/pkg.go b/pkg/pkg.go index 5d9d8d48..fbd8755f 100644 --- a/pkg/pkg.go +++ b/pkg/pkg.go @@ -1521,7 +1521,7 @@ func (c *Cache) openFile( id := c.Ident(f) if c.msg.IsVerbose() { rn := reportName(f, id) - c.msg.Verbosef("curing %s%s%s in memory...", c.sgrIdent, rn, c.sgrRes) + c.msg.Verbosef("opening %s%s%s...", c.sgrIdent, rn, c.sgrRes) defer func() { if err == nil { c.msg.Verbosef("opened %s%s%s for reading", c.sgrIdent, rn, c.sgrRes) @@ -2053,6 +2053,9 @@ func WhenceString(whence int) string { } } +// isType returns whether v is of concrete type T. +func isType[T any](v any) bool { _, ok := v.(T); return ok } + // cure implements Cure without acquiring a read lock on abortMu. cure must not // be entered during Abort. func (c *Cache) cure(a Artifact, curesExempt, rebuild bool) ( @@ -2170,7 +2173,7 @@ func (c *Cache) cure(a Artifact, curesExempt, rebuild bool) ( } whence = WNew - if c.msg.IsVerbose() { + if c.msg.IsVerbose() && !isType[*Collect](a) { rn := reportName(a, id) c.msg.Verbosef("curing %s%s%s...", c.sgrIdent, rn, c.sgrRes) defer func() { @@ -2504,7 +2507,7 @@ func (c *Cache) cure(a Artifact, curesExempt, rebuild bool) ( err = f.linkSubstitute(ids, substitutes) } if err != nil { - if c.msg.IsVerbose() { + if c.msg.IsVerbose() && !IsCollected(err) { c.msg.Verbosef( "cure %s%s%s: %s%v%s", c.sgrIdent, reportName(ca, id), c.sgrRes, -- cgit v1.3.1